mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 18:40:38 +00:00
do not write stack variables
This code is blatantly wrong, because it writes stack variables to the underlying storage. After this patch, the code is no longer wrong. Right is better than wrong, so we should apply this. Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
@@ -419,9 +419,7 @@ future<> parse(random_access_reader& in, disk_hash<Size, Key, Value>& h) {
|
||||
template <typename Key, typename Value>
|
||||
future<> write(file_writer& out, std::unordered_map<Key, Value>& map) {
|
||||
return do_for_each(map.begin(), map.end(), [&out, &map] (auto& val) {
|
||||
Key key = val.first;
|
||||
Value value = val.second;
|
||||
return write(out, key, value);
|
||||
return write(out, val.first, val.second);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user