From 5702bd0a12a439a97b73e2a79dc1ebd9a92b7219 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Sun, 16 Mar 2025 18:41:26 +0100 Subject: [PATCH] refactor(performance_monitor): pass namespaces by value --- include/dwarfs/performance_monitor.h | 2 +- src/performance_monitor.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/dwarfs/performance_monitor.h b/include/dwarfs/performance_monitor.h index 96b7a6c5..b6b4d298 100644 --- a/include/dwarfs/performance_monitor.h +++ b/include/dwarfs/performance_monitor.h @@ -45,7 +45,7 @@ class performance_monitor { static inline constexpr size_t kNumInlineContext{3}; static std::unique_ptr - create(std::unordered_set const& enabled_namespaces, + create(std::unordered_set enabled_namespaces, std::shared_ptr fa = nullptr, std::optional trace_file = std::nullopt); diff --git a/src/performance_monitor.cpp b/src/performance_monitor.cpp index 0dc09fba..a3a99ca2 100644 --- a/src/performance_monitor.cpp +++ b/src/performance_monitor.cpp @@ -380,10 +380,10 @@ performance_monitor_proxy::performance_monitor_proxy( : mon_{mon && mon->is_enabled(mon_namespace) ? std::move(mon) : nullptr} , namespace_{mon_namespace} {} -std::unique_ptr performance_monitor::create( - std::unordered_set const& enabled_namespaces, - std::shared_ptr fa, - std::optional trace_file) { +std::unique_ptr +performance_monitor::create(std::unordered_set enabled_namespaces, + std::shared_ptr fa, + std::optional trace_file) { return enabled_namespaces.empty() ? nullptr : std::make_unique(