|
|
|
@ -16,13 +16,16 @@ |
|
|
|
|
#define GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__ |
|
|
|
|
|
|
|
|
|
#include <algorithm> |
|
|
|
|
#include <memory> |
|
|
|
|
#include <cstddef> |
|
|
|
|
#include <cstdint> |
|
|
|
|
#include <string> |
|
|
|
|
#include <vector> |
|
|
|
|
|
|
|
|
|
#include "absl/container/flat_hash_map.h" |
|
|
|
|
#include "absl/log/absl_log.h" |
|
|
|
|
#include "absl/synchronization/mutex.h" |
|
|
|
|
#include "google/protobuf/descriptor.h" |
|
|
|
|
#include "google/protobuf/message.h" |
|
|
|
|
#include "google/protobuf/port.h" |
|
|
|
|
#include "google/protobuf/reflection.h" |
|
|
|
|
#include "google/protobuf/repeated_field.h" |
|
|
|
|
|
|
|
|
@ -140,7 +143,7 @@ class PROTOBUF_EXPORT DynamicMapSorter { |
|
|
|
|
std::stable_sort(result.begin(), result.end(), comparator); |
|
|
|
|
// Complain if the keys aren't in ascending order.
|
|
|
|
|
#ifndef NDEBUG |
|
|
|
|
for (size_t j = 1; j < static_cast<size_t>(map_size); j++) { |
|
|
|
|
for (size_t j = 1; j < static_cast<size_t>(map_size); ++j) { |
|
|
|
|
if (!comparator(result[j - 1], result[j])) { |
|
|
|
|
ABSL_LOG(ERROR) << (comparator(result[j], result[j - 1]) |
|
|
|
|
? "internal error in map key sorting" |
|
|
|
|