Skip to content

Commit

Permalink
sstables: avoid copying val
Browse files Browse the repository at this point in the history
Noted by Avi while we were searching for a fix for an unrelated bug.
We haven't actually seen this trigger, but the current in-tree behavior
is wrong.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
  • Loading branch information
glommer committed May 26, 2015
1 parent 78b93b2 commit 7013791
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sstables/sstables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,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) {
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);
Expand Down

0 comments on commit 7013791

Please sign in to comment.