wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src config.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src config.cpp
Date: Thu, 24 Mar 2005 03:19:13 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/03/24 08:19:13

Modified files:
        src            : config.cpp 

Log message:
        Simplify config comparisons. Not strictly equivalent, but it would be 
the hint of a bug elsewhere if some behaviors were changed.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/config.cpp.diff?tr1=1.133&tr2=1.134&r1=text&r2=text

Patches:
Index: wesnoth/src/config.cpp
diff -u wesnoth/src/config.cpp:1.133 wesnoth/src/config.cpp:1.134
--- wesnoth/src/config.cpp:1.133        Wed Mar 23 08:23:05 2005
+++ wesnoth/src/config.cpp      Thu Mar 24 08:19:13 2005
@@ -1,7 +1,8 @@
-/* $Id: config.cpp,v 1.133 2005/03/23 08:23:05 silene Exp $ */
+/* $Id: config.cpp,v 1.134 2005/03/24 08:19:13 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
-   Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
+   Copyright (C) 2005 by Guillaume Melquiond <address@hidden>
+   Part of the Battle for Wesnoth Project http://www.wesnoth.org/
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License.
@@ -16,9 +17,9 @@
 #include <algorithm>
 #include <sstream>
 #include "config.hpp"
+#include "log.hpp"
 #include "variable.hpp"
 #include "wassert.hpp"
-#include "log.hpp"
 
 #define ERR_CF lg::err(lg::config)
 
@@ -280,14 +281,6 @@
                return NULL;
 }
 
-#if 0
-bool config::has_value(const std::string& values, const std::string& val)
-{
-       const std::vector<std::string>& vals = split(values);
-       return std::count(vals.begin(),vals.end(),val) > 0;
-}
-#endif
-
 void config::clear()
 {
        for(std::map<std::string,std::vector<config*> >::iterator i = 
children.begin(); i != children.end(); ++i) {
@@ -514,16 +507,8 @@
 
 bool operator==(const config& a, const config& b)
 {
-       if(a.values.size() != b.values.size()) {
+       if (a.values != b.values)
                return false;
-       }
-
-       for(string_map::const_iterator i = a.values.begin(); i != 
a.values.end(); ++i) {
-               const string_map::const_iterator j = b.values.find(i->first);
-               if(j == b.values.end() || i->second != j->second) {
-                       return false;
-               }
-       }
 
        config::all_children_iterator x = a.ordered_begin(), y = 
b.ordered_begin();
        while(x != a.ordered_end() && y != b.ordered_end()) {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]