This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 309d832ddf Fix txn_box unused find result (#13291)
309d832ddf is described below

commit 309d832ddf1874bbe7b672b274b3a5c89328621c
Author: Brian Neradt <[email protected]>
AuthorDate: Thu Jun 18 10:41:21 2026 -0500

    Fix txn_box unused find result (#13291)
    
    Clang 22 treats the ignored std::unordered_map::find result in the
    txn_box unit perf test as a warning, and the project builds with
    warnings promoted to errors. The test therefore fails to compile even
    though the lookup is intentionally only being timed.
    
    This explicitly discards the lookup result in the benchmark lambda and
    corrects the printed label to describe the lookup operation.
---
 plugins/experimental/txn_box/unit_tests/test_accl_utils.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins/experimental/txn_box/unit_tests/test_accl_utils.cc 
b/plugins/experimental/txn_box/unit_tests/test_accl_utils.cc
index 1359a1c0f1..ccc998e870 100644
--- a/plugins/experimental/txn_box/unit_tests/test_accl_utils.cc
+++ b/plugins/experimental/txn_box/unit_tests/test_accl_utils.cc
@@ -337,8 +337,9 @@ TEST_CASE("Very basic perf test")
     }
     {
       func_timer<> f;
-      auto const  &took = f.run([&map]() { map.find("ASF.com"); });
-      std::cout << "std::unordered_map - insert(\"ASF.com\") took " << took << 
to_string<func_timer<>::unit>::value << std::endl;
+      // Only time the lookup dispatch; the returned iterator is intentionally 
unused.
+      auto const &took = f.run([&map]() { 
static_cast<void>(map.find("ASF.com")); });
+      std::cout << "std::unordered_map - find(\"ASF.com\") took " << took << 
to_string<func_timer<>::unit>::value << std::endl;
     }
   }
 }

Reply via email to