aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/hashmap.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/common/hashmap.h b/common/hashmap.h
index 8510fdfbbc..89b06bd5de 100644
--- a/common/hashmap.h
+++ b/common/hashmap.h
@@ -102,10 +102,6 @@ public:
return new Node(key);
}
- Node *allocNode(Node &copy) {
- return new Node(copy);
- }
-
void freeNode(Node *node) {
delete node;
}
@@ -388,7 +384,8 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::assign(const HM_t& map) {
_nele = 0;
for (uint ctr = 0; ctr < _arrsize; ++ctr) {
if (map._arr[ctr] != NULL) {
- _arr[ctr] = allocNode(*map._arr[ctr]);
+ _arr[ctr] = allocNode(map._arr[ctr]->_key);
+ _arr[ctr]->_value = map._arr[ctr]->_value;
_nele++;
}
}