diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2017-07-18 16:26:16 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2017-07-18 16:26:16 -0700 |
commit | 3af881c7e2db0553207876acbdb91c6e77974e44 (patch) | |
tree | 35e2a96cce802d4235bd29afa396e28ead892fa2 /src/google/protobuf/map_entry_lite.h | |
parent | 86975301f1876ce1934612777b8ca6c76520f5cc (diff) | |
parent | 942a29cecd36f2a4b22fdd2179635cd548e6bd27 (diff) |
Merge master into 3.4.x
Diffstat (limited to 'src/google/protobuf/map_entry_lite.h')
-rw-r--r-- | src/google/protobuf/map_entry_lite.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/google/protobuf/map_entry_lite.h b/src/google/protobuf/map_entry_lite.h index d245cfc7..0bccf4d2 100644 --- a/src/google/protobuf/map_entry_lite.h +++ b/src/google/protobuf/map_entry_lite.h @@ -227,8 +227,10 @@ class MapEntryImpl : public Base { size_t ByteSizeLong() const { size_t size = 0; - size += has_key() ? kTagSize + KeyTypeHandler::ByteSize(key()) : 0; - size += has_value() ? kTagSize + ValueTypeHandler::ByteSize(value()) : 0; + size += has_key() ? + kTagSize + static_cast<size_t>(KeyTypeHandler::ByteSize(key())) : 0; + size += has_value() ? + kTagSize + static_cast<size_t>(ValueTypeHandler::ByteSize(value())) : 0; return size; } @@ -251,11 +253,10 @@ class MapEntryImpl : public Base { int GetCachedSize() const { int size = 0; size += has_key() - ? kTagSize + KeyTypeHandler::GetCachedSize(key()) + ? static_cast<int>(kTagSize) + KeyTypeHandler::GetCachedSize(key()) : 0; size += has_value() - ? kTagSize + ValueTypeHandler::GetCachedSize( - value()) + ? static_cast<int>(kTagSize) + ValueTypeHandler::GetCachedSize(value()) : 0; return size; } |