[Wesnoth-commits] r9993 - /trunk/src/config.cpp (February 05, 2006 - 15:54)

Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Headers

 

Author: xan
Date: Sun Feb  5 15:53:51 2006
New Revision: 9993

URL: http://svn.gna.org/viewcvs/wesnoth?rev=9993&view=rev
Log:
config::merge_with now appends tag which are not found.

Modified:
    trunk/src/config.cpp

Modified: trunk/src/config.cpp
URL: http://svn.gna.org/viewcvs/wesnoth/trunk/src/config.cpp?rev=9993&r1=9992&r2=9993&view=diff
==============================================================================
--- trunk/src/config.cpp (original)
+++ trunk/src/config.cpp Sun Feb  5 15:53:51 2006
@@ -535,13 +535,10 @@
 	}
 	const child_map& child_changes = c.all_children();
 	child_map::const_iterator i;
-//	std::map<std::string , size_t> index_map;
 	for(i = child_changes.begin(); i != child_changes.end(); ++i) {
-//		const size_t index = index_map[(*i).first]++;
 		
 		size_t index = 0;
 		for(const_child_iterator j = i->second.begin(); j != i->second.end(); ++j) {
-			//const std::pair<const std::string*,const config*> item = *j;
 			const config* item = *j;
 			
 			if(i->first.empty()) {
@@ -549,9 +546,10 @@
 			}
 
 			const child_map::iterator itor = n.children.find(i->first);
-			//const child_map::iterator itor = children.find(*item.first);
 			if(itor != n.children.end() && index < itor->second.size()) {
 				*(itor->second[index]) = itor->second[index]->merge_with(*item);
+			} else {
+				n.add_child(i->first,*item);
 			}
 
 			index++;



Related Mails




Powered by MHonArc, Updated Sun Feb 05 17:20:14 2006