aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/map.h
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2018-09-07 16:15:38 -0700
committerGitHub <noreply@github.com>2018-09-07 16:15:38 -0700
commitf9d8138376765d229a32635c9209061e4e4aed8c (patch)
tree50719686fd7262f405c9bda8694d6c72e7c038b8 /src/google/protobuf/map.h
parent2e7563f40ec7f901ae8ae1cc749d701fa07e211d (diff)
parente53be9bce4556cf0d13e24f1a25a7d75f663144f (diff)
downloadprotobuf-f9d8138376765d229a32635c9209061e4e4aed8c.tar.gz
protobuf-f9d8138376765d229a32635c9209061e4e4aed8c.tar.bz2
protobuf-f9d8138376765d229a32635c9209061e4e4aed8c.zip
Merge pull request #5109 from haberman/integrate
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/map.h')
-rw-r--r--src/google/protobuf/map.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h
index c5afa200..a7126c16 100644
--- a/src/google/protobuf/map.h
+++ b/src/google/protobuf/map.h
@@ -53,6 +53,8 @@
#error "You cannot SWIG proto headers"
#endif
+#include <google/protobuf/port_def.inc>
+
namespace google {
namespace protobuf {
@@ -626,7 +628,7 @@ class Map {
}
DestroyNode(item);
--num_elements_;
- if (GOOGLE_PREDICT_FALSE(b == index_of_first_non_null_)) {
+ if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) {
while (index_of_first_non_null_ < num_buckets_ &&
table_[index_of_first_non_null_] == NULL) {
++index_of_first_non_null_;
@@ -683,7 +685,7 @@ class Map {
if (TableEntryIsEmpty(b)) {
result = InsertUniqueInList(b, node);
} else if (TableEntryIsNonEmptyList(b)) {
- if (GOOGLE_PREDICT_FALSE(TableEntryIsTooLong(b))) {
+ if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) {
TreeConvert(b);
result = InsertUniqueInTree(b, node);
GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1));
@@ -738,13 +740,13 @@ class Map {
// We don't care how many elements are in trees. If a lot are,
// we may resize even though there are many empty buckets. In
// practice, this seems fine.
- if (GOOGLE_PREDICT_FALSE(new_size >= hi_cutoff)) {
+ if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) {
if (num_buckets_ <= max_size() / 2) {
Resize(num_buckets_ * 2);
return true;
}
- } else if (GOOGLE_PREDICT_FALSE(new_size <= lo_cutoff &&
- num_buckets_ > kMinTableSize)) {
+ } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff &&
+ num_buckets_ > kMinTableSize)) {
size_type lg2_of_size_reduction_factor = 1;
// It's possible we want to shrink a lot here... size() could even be 0.
// So, estimate how much to shrink by making sure we don't shrink so
@@ -1219,4 +1221,6 @@ class Map {
} // namespace protobuf
} // namespace google
+#include <google/protobuf/port_undef.inc>
+
#endif // GOOGLE_PROTOBUF_MAP_H__