Always create a new kv pair to avoid using shared strings

This commit is contained in:
Michael Krasnyk 2018-04-04 11:31:55 +02:00 committed by Patrick Niklaus
parent 9889a454ce
commit 14d2199cd8

View File

@ -245,10 +245,10 @@ write<bool>(tar::FileWriter &writer, const std::string &name, const std::vector<
template <typename K, typename V> void read(io::BufferReader &reader, std::map<K, V> &data)
{
const auto count = reader.ReadElementCount64();
std::pair<K, V> pair;
for (auto index : util::irange<std::size_t>(0, count))
{
(void)index;
std::pair<K, V> pair;
read(reader, pair.first);
read(reader, pair.second);
data.insert(pair);