diff options
author | Giuliano Procida <gprocida@google.com> | 2024-04-25 19:52:07 +0100 |
---|---|---|
committer | Giuliano Procida <gprocida@google.com> | 2024-04-25 22:06:21 +0100 |
commit | 27ca78441c3fd6ddfd0a06587272b5d748fb4d4a (patch) | |
tree | a709a8934d7fcb0e669c446dde7ca37eed2aeb77 | |
parent | 0cdd97b7a7c5a0452f2504005eb8505ce26153a2 (diff) | |
download | stg-27ca78441c3fd6ddfd0a06587272b5d748fb4d4a.tar.gz |
proto writer: take references to key/value pairs in ID mapping loop
This inhibits compiler warnings about copying.
PiperOrigin-RevId: 628145549
Change-Id: I3ec78035affdb34f8a1b70f419e44de89f4002a7
-rw-r--r-- | proto_writer.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/proto_writer.cc b/proto_writer.cc index ccbd683..919c5e8 100644 --- a/proto_writer.cc +++ b/proto_writer.cc @@ -94,7 +94,7 @@ struct Transform { std::unordered_map<uint32_t, Id> GetInternalIdByExternalIdMap() { std::unordered_map<uint32_t, Id> internal_id_map; - for (const auto [id, ext_id] : external_id_by_internal_id) { + for (const auto& [id, ext_id] : external_id_by_internal_id) { internal_id_map.emplace(ext_id, id); } return internal_id_map; |