From 9b35c0d5e08f3d88e4743b81f3ddc5167a19c0d8 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Fri, 22 Nov 2024 10:21:57 +0100 Subject: [PATCH] update(userspace/falco): use ternary operator Co-authored-by: Samuel Gaist Signed-off-by: Federico Di Pierro --- userspace/falco/app/actions/helpers_inspector.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/userspace/falco/app/actions/helpers_inspector.cpp b/userspace/falco/app/actions/helpers_inspector.cpp index 9620f5d479f..e476326c4ee 100644 --- a/userspace/falco/app/actions/helpers_inspector.cpp +++ b/userspace/falco/app/actions/helpers_inspector.cpp @@ -61,15 +61,11 @@ falco::app::run_result falco::app::actions::open_live_inspector(falco::app::stat falco_logger::log( falco_logger::level::INFO, "Opening '" + source + "' source with plugin '" + cfg->m_name + "'"); - if(s.config->m_plugins_hostinfo) { - inspector->open_plugin(cfg->m_name, - cfg->m_open_params, - sinsp_plugin_platform::SINSP_PLATFORM_HOSTINFO); - } else { - inspector->open_plugin(cfg->m_name, - cfg->m_open_params, - sinsp_plugin_platform::SINSP_PLATFORM_GENERIC); - } + inspector->open_plugin(cfg->m_name, + cfg->m_open_params, + s.config->m_plugins_hostinfo + ? sinsp_plugin_platform::SINSP_PLATFORM_HOSTINFO + : sinsp_plugin_platform::SINSP_PLATFORM_GENERIC); return run_result::ok(); } }