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

laiyingchun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new 5057aadab fix(util): Fix the key doesn't print when check failed 
(#2090)
5057aadab is described below

commit 5057aadab70531fac64ab16f01aaaa1e536618d7
Author: Yingchun Lai <[email protected]>
AuthorDate: Wed Aug 7 14:05:31 2024 +0800

    fix(util): Fix the key doesn't print when check failed (#2090)
---
 src/gutil/map_util.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gutil/map_util.h b/src/gutil/map_util.h
index e8788e4ab..4ce286fc0 100644
--- a/src/gutil/map_util.h
+++ b/src/gutil/map_util.h
@@ -406,7 +406,7 @@ void InsertOrDieNoPrint(M *m, const MapUtilInitT<M> &value)
 template <typename M>
 void InsertOrDie(M *m, const MapUtilKeyT<M> &key, const MapUtilMappedT<M> 
&data)
 {
-    CHECK(InsertIfNotPresent(m, key, data), "duplicate key: ", key);
+    CHECK(InsertIfNotPresent(m, key, data), "duplicate key: {}", key);
 }
 
 // Same as above except doesn't log the key on error.
@@ -427,7 +427,7 @@ auto InsertKeyOrDie(M *m, const MapUtilKeyT<M> &key) ->
     typename std::enable_if<internal_map_util::HasTryEmplace<M>::value, 
MapUtilMappedT<M> &>::type
 {
     auto res = m->try_emplace(key);
-    CHECK(res.second, "duplicate key: ", key);
+    CHECK(res.second, "duplicate key: {}", key);
     return gutil::subtle::GetMapped(*res.first);
 }
 
@@ -437,7 +437,7 @@ auto InsertKeyOrDie(M *m, const MapUtilKeyT<M> &key) ->
     typename std::enable_if<!internal_map_util::HasTryEmplace<M>::value, 
MapUtilMappedT<M> &>::type
 {
     auto res = m->insert(MapUtilValueT<M>(key, MapUtilMappedT<M>()));
-    CHECK(res.second, "duplicate key: ", key);
+    CHECK(res.second, "duplicate key: {}", key);
     return res.first->second;
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to