mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-18 08:41:31 +00:00
update(userspace/falco): use unordered_set where possible for faster lookups
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
909f6d0961
commit
21c2b1f472
@ -28,6 +28,7 @@ limitations under the License.
|
||||
|
||||
#include <string>
|
||||
#include <atomic>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace falco {
|
||||
namespace app {
|
||||
@ -94,11 +95,11 @@ private:
|
||||
|
||||
// The set of loaded event sources (by default, the syscall event
|
||||
// source plus all event sources coming from the loaded plugins)
|
||||
std::set<std::string> loaded_sources;
|
||||
std::unordered_set<std::string> loaded_sources;
|
||||
|
||||
// The set of enabled event sources (can be altered by using
|
||||
// the --enable-source and --disable-source options)
|
||||
std::set<std::string> enabled_sources;
|
||||
std::unordered_set<std::string> enabled_sources;
|
||||
|
||||
// Used to load all plugins to get their info. In capture mode,
|
||||
// this is also used to open the capture file and read its events
|
||||
@ -152,7 +153,7 @@ private:
|
||||
}
|
||||
|
||||
// Failure result that causes the program to stop with an error
|
||||
inline static run_result fatal(std::string err)
|
||||
inline static run_result fatal(const std::string& err)
|
||||
{
|
||||
run_result r;
|
||||
r.success = false;
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <sinsp.h>
|
||||
#include <token_bucket.h>
|
||||
@ -34,7 +34,7 @@ enum class syscall_evt_drop_action : uint8_t
|
||||
EXIT
|
||||
};
|
||||
|
||||
using syscall_evt_drop_actions = std::set<syscall_evt_drop_action>;
|
||||
using syscall_evt_drop_actions = std::unordered_set<syscall_evt_drop_action>;
|
||||
|
||||
class syscall_evt_drop_mgr
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user