[Scummvm-cvs-logs] SF.net SVN: scummvm: [31314] scummvm/trunk/common/hashmap.h

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Mar 30 04:36:23 CEST 2008


Revision: 31314
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31314&view=rev
Author:   lordhoto
Date:     2008-03-29 19:36:23 -0700 (Sat, 29 Mar 2008)

Log Message:
-----------
Fixed hashmap code. (please make a better check next time when changing code in common/, this was a really bad one :-/)

Modified Paths:
--------------
    scummvm/trunk/common/hashmap.h

Modified: scummvm/trunk/common/hashmap.h
===================================================================
--- scummvm/trunk/common/hashmap.h	2008-03-30 01:35:12 UTC (rev 31313)
+++ scummvm/trunk/common/hashmap.h	2008-03-30 02:36:23 UTC (rev 31314)
@@ -98,11 +98,15 @@
 		Node(const Key &key) : _key(key), _value() {}
 	};
 
-	Node* allocNode(const Key& key) {
+	Node *allocNode(const Key& key) {
 		return new Node(key);
 	} 
 
-	void freeNode(Node* node) {
+	Node *allocNode(Node &copy) {
+		return new Node(copy);
+	}
+
+	void freeNode(Node *node) {
 		delete node;
 	}
 
@@ -384,7 +388,7 @@
 	_nele = 0;
 	for (uint ctr = 0; ctr < _arrsize; ++ctr) {
 		if (map._arr[ctr] != NULL) {
-			_arr[ctr] = allocNode(map._arr[ctr]->_key);
+			_arr[ctr] = allocNode(*map._arr[ctr]);
 			_nele++;
 		}
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list