From 14d2199cd822085822bbe6859b19fbd6dd4759d6 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Wed, 4 Apr 2018 11:31:55 +0200 Subject: [PATCH] Always create a new kv pair to avoid using shared strings --- include/storage/serialization.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/storage/serialization.hpp b/include/storage/serialization.hpp index af0d3ec77..92ee9600c 100644 --- a/include/storage/serialization.hpp +++ b/include/storage/serialization.hpp @@ -245,10 +245,10 @@ write(tar::FileWriter &writer, const std::string &name, const std::vector< template void read(io::BufferReader &reader, std::map &data) { const auto count = reader.ReadElementCount64(); - std::pair pair; for (auto index : util::irange(0, count)) { (void)index; + std::pair pair; read(reader, pair.first); read(reader, pair.second); data.insert(pair);