Always create a new kv pair to avoid using shared strings
This commit is contained in:
		
							parent
							
								
									9889a454ce
								
							
						
					
					
						commit
						14d2199cd8
					
				@ -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)
 | 
					template <typename K, typename V> void read(io::BufferReader &reader, std::map<K, V> &data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const auto count = reader.ReadElementCount64();
 | 
					    const auto count = reader.ReadElementCount64();
 | 
				
			||||||
    std::pair<K, V> pair;
 | 
					 | 
				
			||||||
    for (auto index : util::irange<std::size_t>(0, count))
 | 
					    for (auto index : util::irange<std::size_t>(0, count))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        (void)index;
 | 
					        (void)index;
 | 
				
			||||||
 | 
					        std::pair<K, V> pair;
 | 
				
			||||||
        read(reader, pair.first);
 | 
					        read(reader, pair.first);
 | 
				
			||||||
        read(reader, pair.second);
 | 
					        read(reader, pair.second);
 | 
				
			||||||
        data.insert(pair);
 | 
					        data.insert(pair);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user