From 3ca7214a635795f1610e3f1775ea11cb4c9b3410 Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 2 Apr 2014 06:13:06 +0000 Subject: [PATCH] *Core: Fixed T& SortedArrayMap::Add(K) git-svn-id: svn://ultimatepp.org/upp/trunk@7132 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/InMap.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/uppsrc/Core/InMap.hpp b/uppsrc/Core/InMap.hpp index 8dc5f9d7d..b3c8e7ca6 100644 --- a/uppsrc/Core/InMap.hpp +++ b/uppsrc/Core/InMap.hpp @@ -149,10 +149,9 @@ void Slaved_InArray__::Remove(int blki, int pos, int n) template void Slaved_InArray__::AddFirst() { - if(res) - data.iv.data.Add().Add(res); - else - data.iv.data.Add().Add(); + if(!res) + res = new T; + data.iv.data.Add().Add(res); } template