瀏覽代碼

Be consistent with the use of CHECK()/ GOOGLE_CHECK().

Clement Courbet 9 年之前
父節點
當前提交
c466f4b539
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/google/protobuf/stubs/map_util.h

+ 4 - 3
src/google/protobuf/stubs/map_util.h

@@ -208,7 +208,7 @@ typename Collection::value_type::second_type::element_type&
 FindLinkedPtrOrDie(const Collection& collection,
 FindLinkedPtrOrDie(const Collection& collection,
                    const typename Collection::value_type::first_type& key) {
                    const typename Collection::value_type::first_type& key) {
   typename Collection::const_iterator it = collection.find(key);
   typename Collection::const_iterator it = collection.find(key);
-  CHECK(it != collection.end()) <<  "key not found: " << key;
+  GOOGLE_CHECK(it != collection.end()) <<  "key not found: " << key;
   // Since linked_ptr::operator*() is a const member returning a non const,
   // Since linked_ptr::operator*() is a const member returning a non const,
   // we do not need a version of this function taking a non const collection.
   // we do not need a version of this function taking a non const collection.
   return *it->second;
   return *it->second;
@@ -337,14 +337,15 @@ bool InsertIfNotPresent(
 template <class Collection>
 template <class Collection>
 void InsertOrDie(Collection* const collection,
 void InsertOrDie(Collection* const collection,
                  const typename Collection::value_type& value) {
                  const typename Collection::value_type& value) {
-  CHECK(InsertIfNotPresent(collection, value)) << "duplicate value: " << value;
+  GOOGLE_CHECK(InsertIfNotPresent(collection, value))
+      << "duplicate value: " << value;
 }
 }
 
 
 // Same as above except doesn't log the value on error.
 // Same as above except doesn't log the value on error.
 template <class Collection>
 template <class Collection>
 void InsertOrDieNoPrint(Collection* const collection,
 void InsertOrDieNoPrint(Collection* const collection,
                         const typename Collection::value_type& value) {
                         const typename Collection::value_type& value) {
-  CHECK(InsertIfNotPresent(collection, value)) << "duplicate value.";
+  GOOGLE_CHECK(InsertIfNotPresent(collection, value)) << "duplicate value.";
 }
 }
 
 
 // Inserts the key-value pair into the collection. Dies if key was already
 // Inserts the key-value pair into the collection. Dies if key was already