aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeng Xiao <xiaofeng@google.com>2016-07-29 12:26:24 -0700
committerGitHub <noreply@github.com>2016-07-29 12:26:24 -0700
commit42e54876be41fdf0b22dea4e4ea7f416d5d1f3ec (patch)
treedae15a8649352e6e9c2ed982578e9292b45c6f98
parente7982e409deab9cb4390dd574441604e846caf7f (diff)
parentc466f4b5390fecc7d5c424af66ebfbdf88cdf483 (diff)
downloadprotobuf-42e54876be41fdf0b22dea4e4ea7f416d5d1f3ec.tar.gz
protobuf-42e54876be41fdf0b22dea4e4ea7f416d5d1f3ec.tar.bz2
protobuf-42e54876be41fdf0b22dea4e4ea7f416d5d1f3ec.zip
Merge pull request #1882 from legrosbuffle/fix-check
Be consistent with the use of CHECK()/ GOOGLE_CHECK().
-rw-r--r--src/google/protobuf/stubs/map_util.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/google/protobuf/stubs/map_util.h b/src/google/protobuf/stubs/map_util.h
index 4cccbbed..887f12a6 100644
--- a/src/google/protobuf/stubs/map_util.h
+++ b/src/google/protobuf/stubs/map_util.h
@@ -208,7 +208,7 @@ typename Collection::value_type::second_type::element_type&
FindLinkedPtrOrDie(const Collection& collection,
const typename Collection::value_type::first_type& 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,
// we do not need a version of this function taking a non const collection.
return *it->second;
@@ -337,14 +337,15 @@ bool InsertIfNotPresent(
template <class Collection>
void InsertOrDie(Collection* const collection,
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.
template <class Collection>
void InsertOrDieNoPrint(Collection* const collection,
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