From 8e4a5ec679ce1741d754a49d1126fa0da839e489 Mon Sep 17 00:00:00 2001 From: ktlo Date: Thu, 20 Aug 2020 11:24:49 +0000 Subject: [PATCH] tag_compound::tag fix --- include/nbt.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nbt.hpp b/include/nbt.hpp index 4284a12..525fb7c 100644 --- a/include/nbt.hpp +++ b/include/nbt.hpp @@ -854,8 +854,8 @@ namespace tags { auto iter = value.find(name); if (iter == value.end()) { auto ptr = std::make_unique>(); - typename tag_of::value_type & result = *ptr->value; - value.insert(name, std::move(ptr)); + typename tag_of::value_type & result = ptr->value; + value.emplace(name, std::move(ptr)); return result; } else { return dynamic_cast &>(*iter->second).value;