Browse Source

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

Matt Benic 10 years ago
parent
commit
3a06bc65b6
1 changed files with 6 additions and 3 deletions
  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)
     Iterator InsertNew(const T& key, const U& value)
     {
     {
         unsigned hashKey = Hash(key);
         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);
         return InsertNode(key, value, false);
     }
     }