aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/map_entry_lite.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/map_entry_lite.h')
-rw-r--r--src/google/protobuf/map_entry_lite.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/google/protobuf/map_entry_lite.h b/src/google/protobuf/map_entry_lite.h
index 1646ce43..85a0bed7 100644
--- a/src/google/protobuf/map_entry_lite.h
+++ b/src/google/protobuf/map_entry_lite.h
@@ -33,6 +33,7 @@
#include <assert.h>
+#include <google/protobuf/stubs/casts.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/map.h>
@@ -201,8 +202,7 @@ class MapEntryImpl : public Base {
return false;
}
set_has_key();
- if (!input->ExpectTag(kValueTag)) break;
- GOOGLE_FALLTHROUGH_INTENDED;
+ break;
case kValueTag:
if (!ValueTypeHandler::Read(input, mutable_value())) {
@@ -355,9 +355,9 @@ class MapEntryImpl : public Base {
// We could use memcmp here, but we don't bother. The tag is one byte.
GOOGLE_COMPILE_ASSERT(kTagSize == 1, tag_size_error);
if (size > 0 && *reinterpret_cast<const char*>(data) == kValueTag) {
- typename Map::size_type size = map_->size();
+ typename Map::size_type map_size = map_->size();
value_ptr_ = &(*map_)[key_];
- if (GOOGLE_PREDICT_TRUE(size != map_->size())) {
+ if (GOOGLE_PREDICT_TRUE(map_size != map_->size())) {
// We created a new key-value pair. Fill in the value.
typedef
typename MapIf<ValueTypeHandler::kIsEnum, int*, Value*>::type T;
@@ -432,7 +432,7 @@ class MapEntryImpl : public Base {
Value* value_ptr_;
// On the fast path entry_ is not used. And, when entry_ is used, it's set
// to mf_->NewEntry(), so in the arena case we must call entry_.release.
- google::protobuf::scoped_ptr<MapEntryImpl> entry_;
+ std::unique_ptr<MapEntryImpl> entry_;
};
protected:
@@ -604,7 +604,7 @@ template <>
struct FromHelper<WireFormatLite::TYPE_STRING> {
static ArenaStringPtr From(const string& x) {
ArenaStringPtr res;
- TaggedPtr< ::std::string> ptr;
+ TaggedPtr<::std::string> ptr;
ptr.Set(const_cast<string*>(&x));
res.UnsafeSetTaggedPointer(ptr);
return res;
@@ -614,7 +614,7 @@ template <>
struct FromHelper<WireFormatLite::TYPE_BYTES> {
static ArenaStringPtr From(const string& x) {
ArenaStringPtr res;
- TaggedPtr< ::std::string> ptr;
+ TaggedPtr<::std::string> ptr;
ptr.Set(const_cast<string*>(&x));
res.UnsafeSetTaggedPointer(ptr);
return res;