]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: mark assert-only variables as unused 57226/head
authorRonen Friedman <rfriedma@redhat.com>
Thu, 2 May 2024 09:33:29 +0000 (12:33 +0300)
committerRonen Friedman <rfriedma@redhat.com>
Thu, 2 May 2024 09:33:29 +0000 (12:33 +0300)
to remove compiler warnings.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/common/perf_counters_cache.cc

index 946b5f5b8edb4fe222022b9f54eff164aa4482d7..fb63b7acfed43e545a8da793e288660b8eece373 100644 (file)
@@ -4,7 +4,7 @@
 namespace ceph::perf_counters {
 
 void PerfCountersCache::check_key(const std::string &key) {
-  std::string_view key_name = ceph::perf_counters::key_name(key);
+  [[maybe_unused]] std::string_view key_name = ceph::perf_counters::key_name(key);
   // don't accept an empty key name
   assert(key_name != "");
 
@@ -13,7 +13,7 @@ void PerfCountersCache::check_key(const std::string &key) {
   assert(key_labels.begin() != key_labels.end());
 
   // don't accept keys where any labels in the key have an empty key name
-  for (auto key_label : key_labels) {
+  for ([[maybe_unused]] auto key_label : key_labels) {
     assert(key_label.first != "");
   }
 }