From b913cbd3073826ea113efe917d4d3ce71b92ab2d Mon Sep 17 00:00:00 2001 From: Peter Kasting Date: Thu, 27 Aug 2015 14:37:18 -0700 Subject: Move StringSpaceUsedIncludingSelf to lite library. This came up because Chromium downstream modifies the lite library in a way that requires this function, but I'm upstreaming it because based on the comments in repeated_field.h, this ought to allow resolution of an existing hack. I don't know enough about the protobuf code to feel confident trying to resolve this hack myself, so I've merely updated the TODO comments. --- src/google/protobuf/generated_message_reflection.cc | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/google/protobuf/generated_message_reflection.cc') diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc index 412c48a1..0b01e73a 100644 --- a/src/google/protobuf/generated_message_reflection.cc +++ b/src/google/protobuf/generated_message_reflection.cc @@ -57,18 +57,6 @@ bool IsMapFieldInApi(const FieldDescriptor* field) { } } // anonymous namespace -int StringSpaceUsedExcludingSelf(const string& str) { - const void* start = &str; - const void* end = &str + 1; - - if (start <= str.data() && str.data() < end) { - // The string's data is stored inside the string object itself. - return 0; - } else { - return str.capacity(); - } -} - bool ParseNamedEnum(const EnumDescriptor* descriptor, const string& name, int* value) { -- cgit v1.2.3