[Scummvm-cvs-logs] SF.net SVN: scummvm: [21480] scummvm/trunk/common

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Mar 28 07:16:16 CEST 2006


Revision: 21480
Author:   fingolfin
Date:     2006-03-28 07:15:45 -0800 (Tue, 28 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21480&view=rev

Log Message:
-----------
Get rid of Map::addKey

Modified Paths:
--------------
    scummvm/trunk/common/config-manager.cpp
    scummvm/trunk/common/map.h
Modified: scummvm/trunk/common/config-manager.cpp
===================================================================
--- scummvm/trunk/common/config-manager.cpp	2006-03-28 15:15:36 UTC (rev 21479)
+++ scummvm/trunk/common/config-manager.cpp	2006-03-28 15:15:45 UTC (rev 21480)
@@ -86,7 +86,7 @@
 
 ConfigManager::ConfigManager() {
 	// Ensure the global domain(s) are setup.
-	_globalDomains.addKey(kApplicationDomain);
+	_globalDomains[kApplicationDomain];
 }
 
 
@@ -126,7 +126,7 @@
 	_transientDomain.clear();
 
 	// Ensure the global domain(s) are setup.
-	_globalDomains.addKey(kApplicationDomain);
+	_globalDomains[kApplicationDomain];
 
 	_filename = filename;
 	_domainSaveOrder.clear();
@@ -483,7 +483,7 @@
 	assert(!domain.empty());
 	assert(isValidDomainName(domain));
 	_activeDomain = domain;
-	_gameDomains.addKey(domain);
+	_gameDomains[domain];
 }
 
 void ConfigManager::removeGameDomain(const String &domain) {

Modified: scummvm/trunk/common/map.h
===================================================================
--- scummvm/trunk/common/map.h	2006-03-28 15:15:36 UTC (rev 21479)
+++ scummvm/trunk/common/map.h	2006-03-28 15:15:45 UTC (rev 21480)
@@ -157,15 +157,6 @@
 		return (_root == 0);
 	}
 
-	Value &addKey(const Key &key) {
-		Node *node;
-		if (!_root)
-			node = _root = new Node(key, _header);
-		else
-			node = findOrCreateNode(_root, key);
-		return node->_value;
-	}
-
 	size_t erase(const Key &key) {
 		// TODO - implement efficiently. Indeed, maybe switch to using red-black trees?
 		// For now, just a lame, bad remove algorithm. Rule: don't remove elements


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