Skip to content

Commit

Permalink
fix(libsinsp): address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Aug 6, 2024
1 parent f5c20e4 commit 8bc17ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions userspace/libsinsp/sinsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ void sinsp::start_dropping_mode(uint32_t sampling_ratio)
}
#endif // _WIN32

void sinsp::set_filter(std::unique_ptr<sinsp_filter> filter, const std::optional<std::string>& filterstring)
void sinsp::set_filter(std::unique_ptr<sinsp_filter> filter, const std::string& filterstring)

Check warning on line 1664 in userspace/libsinsp/sinsp.cpp

View check run for this annotation

Codecov / codecov/patch

userspace/libsinsp/sinsp.cpp#L1664

Added line #L1664 was not covered by tests
{
if(m_filter != NULL)
{
Expand All @@ -1670,7 +1670,7 @@ void sinsp::set_filter(std::unique_ptr<sinsp_filter> filter, const std::optional
}

m_filter = std::move(filter);
m_filterstring = filterstring.value_or("");
m_filterstring = filterstring;

Check warning on line 1673 in userspace/libsinsp/sinsp.cpp

View check run for this annotation

Codecov / codecov/patch

userspace/libsinsp/sinsp.cpp#L1673

Added line #L1673 was not covered by tests
}

void sinsp::set_filter(const std::string& filter)
Expand Down
2 changes: 1 addition & 1 deletion userspace/libsinsp/sinsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class SINSP_PUBLIC sinsp : public capture_stats_source
\param filter the runtime filter object
*/
void set_filter(std::unique_ptr<sinsp_filter> filter, const std::optional<std::string>& filterstring);
void set_filter(std::unique_ptr<sinsp_filter> filter, const std::string& filterstring = "");

/*!
\brief Return the filter set for this capture.
Expand Down

0 comments on commit 8bc17ef

Please sign in to comment.