From db044e2f64494d61b4f2ffe4307043275bb8fc1d Mon Sep 17 00:00:00 2001 From: GoreProgrammer Date: Sun, 4 Jan 2026 18:22:57 +0100 Subject: [PATCH] osd_publish_batch : optimize the Fact loop - use const ref to avoid unnecessary copying. --- src/osd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd.cpp b/src/osd.cpp index e2b2dfdf..e3ae6df8 100644 --- a/src/osd.cpp +++ b/src/osd.cpp @@ -2104,7 +2104,7 @@ void osd_publish_batch(void *batch) { if (enable_osd) { { std::lock_guard lock(mtx); - for (Fact fact : *facts) { + for (const Fact& fact : *facts) { // SPDLOG_DEBUG("batch post fact {}({})", fact.getName(), fact.getTags()); fact_queue.push(fact); }