Change HashMap::Insert()'s value to a const reference (#6567)

Summary:
When building RocksDB on VS2015, an error shows up with

hash_map.h(39): error C2719: 'value': formal parameter with requested alignment of 8 won't be aligned

Making the reference a reference can solve the problem, and there isn't a reason we can't do that, at least for the current use of the hash map.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6567

Test Plan: See CI tests pass.

Reviewed By: pdillinger

Differential Revision: D20548543

fbshipit-source-id: 255b55d74cf68a0b324e6f504c56608a97ea6276
main
sdong 5 years ago committed by Facebook GitHub Bot
parent 66cd07c6d9
commit 6c50fe1ec9
  1. 2
      util/hash_map.h

@ -36,7 +36,7 @@ class HashMap {
return it != bucket.end(); return it != bucket.end();
} }
void Insert(K key, V value) { void Insert(K key, const V& value) {
auto& bucket = table_[key % size]; auto& bucket = table_[key % size];
bucket.push_back({key, value}); bucket.push_back({key, value});
} }

Loading…
Cancel
Save