Explorar o código

Fixed case of InsertNew being used to set the first value in the map.

Matt Benic %!s(int64=10) %!d(string=hai) anos
pai
achega
3a06bc65b6
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  1. 6 3
      Source/Atomic/Container/HashMap.h

+ 6 - 3
Source/Atomic/Container/HashMap.h

@@ -364,9 +364,12 @@ public:
     Iterator InsertNew(const T& key, const U& value)
     {
         unsigned hashKey = Hash(key);
-        Node* node = FindNode(key, hashKey);
-        if (node)
-            return Iterator(node);
+        if (ptrs_) 
+        {
+            Node* node = FindNode(key, hashKey);
+            if (node)
+                return Iterator(node);
+        }
 
         return InsertNode(key, value, false);
     }