summaryrefslogtreecommitdiff
path: root/upbc/message_layout.h
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-05-14 16:14:22 -0700
committerJoshua Haberman <jhaberman@gmail.com>2019-05-14 16:14:22 -0700
commitef9499cb44f58904d55997a9f934f1e477bcba18 (patch)
tree78543cd22fd2d043a4847aef939296f2017ea031 /upbc/message_layout.h
parent06b90f9b693b43a007ee2c20f5e7a98595bd8721 (diff)
Migrate std::unordered_map -> absl::flat_hash_map.
Diffstat (limited to 'upbc/message_layout.h')
-rw-r--r--upbc/message_layout.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/upbc/message_layout.h b/upbc/message_layout.h
index a4cb289..c2446a0 100644
--- a/upbc/message_layout.h
+++ b/upbc/message_layout.h
@@ -2,8 +2,8 @@
#ifndef UPBC_MESSAGE_LAYOUT_H
#define UPBC_MESSAGE_LAYOUT_H
-#include <unordered_map>
#include "absl/base/macros.h"
+#include "absl/container/flat_hash_map.h"
#include "google/protobuf/descriptor.h"
namespace upbc {
@@ -70,7 +70,7 @@ class MessageLayout {
Size Place(SizeAndAlign size_and_align);
template <class K, class V>
- static V GetMapValue(const std::unordered_map<K, V>& map, K key) {
+ static V GetMapValue(const absl::flat_hash_map<K, V>& map, K key) {
auto iter = map.find(key);
if (iter == map.end()) {
fprintf(stderr, "No value for field.\n");
@@ -92,11 +92,11 @@ class MessageLayout {
static int64_t FieldLayoutRank(
const google::protobuf::FieldDescriptor* field);
- std::unordered_map<const google::protobuf::FieldDescriptor*, Size>
+ absl::flat_hash_map<const google::protobuf::FieldDescriptor*, Size>
field_offsets_;
- std::unordered_map<const google::protobuf::FieldDescriptor*, int>
+ absl::flat_hash_map<const google::protobuf::FieldDescriptor*, int>
hasbit_indexes_;
- std::unordered_map<const google::protobuf::OneofDescriptor*, Size>
+ absl::flat_hash_map<const google::protobuf::OneofDescriptor*, Size>
oneof_case_offsets_;
Size maxalign_;
Size size_;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback