diff options
Diffstat (limited to 'src/google/protobuf/dynamic_message.h')
-rw-r--r-- | src/google/protobuf/dynamic_message.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/google/protobuf/dynamic_message.h b/src/google/protobuf/dynamic_message.h index 816170ea..05722171 100644 --- a/src/google/protobuf/dynamic_message.h +++ b/src/google/protobuf/dynamic_message.h @@ -166,14 +166,14 @@ class LIBPROTOBUF_EXPORT DynamicMapSorter { } GOOGLE_DCHECK_EQ(result.size(), static_cast<size_t>(i)); MapEntryMessageComparator comparator(field->message_type()); - std::sort(result.begin(), result.end(), comparator); + std::stable_sort(result.begin(), result.end(), comparator); // Complain if the keys aren't in ascending order. #ifndef NDEBUG for (int j = 1; j < map_size; j++) { if (!comparator(result[j - 1], result[j])) { GOOGLE_LOG(ERROR) << (comparator(result[j], result[j - 1]) ? - "internal error in map key sorting" : - "map keys are not unique"); + "internal error in map key sorting" : + "map keys are not unique"); } } #endif |