From 5503e140d55bd580516a0fb8a42b03df30a72bb8 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Fri, 5 Jun 2015 14:50:50 -0400 Subject: [PATCH] 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 --- sstables/sstables.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sstables/sstables.cc b/sstables/sstables.cc index 73901ba50f..27c2524fc3 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -419,9 +419,7 @@ future<> parse(random_access_reader& in, disk_hash& h) { template future<> write(file_writer& out, std::unordered_map& 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); }); }