mail[Wesnoth-commits] r33989 - /trunk/src/unit_abilities.cpp


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

Header


Content

Posted by guillaume . melquiond on March 21, 2009 - 19:44:
Author: silene
Date: Sat Mar 21 19:44:43 2009
New Revision: 33989

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33989&view=rev
Log:
Moved to loops based on config::all_children_range.

Modified:
    trunk/src/unit_abilities.cpp

Modified: trunk/src/unit_abilities.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_abilities.cpp?rev=33989&r1=33988&r2=33989&view=diff
==============================================================================
--- trunk/src/unit_abilities.cpp (original)
+++ trunk/src/unit_abilities.cpp Sat Mar 21 19:44:43 2009
@@ -532,13 +532,13 @@
 namespace {
        bool get_special_children(std::vector<const config*>& result, const 
config& parent,
                                   const std::string& id, bool 
just_peeking=false) {
-               config::all_children_iterator it, it_end = 
parent.ordered_end();
-               for(it = parent.ordered_begin(); it != it_end; ++it) {
-                       if(it.get_key() == id || it.get_child()["id"] == id) {
+               foreach (const config::any_child &sp, 
parent.all_children_range())
+               {
+                       if (sp.key == id || sp.cfg["id"] == id) {
                                if(just_peeking) {
                                        return true; // peek succeeded, abort
                                } else {
-                                       result.push_back(it->second);
+                                       result.push_back(&sp.cfg);
                                }
                        }
                }




Related Messages


Powered by MHonArc, Updated Sat Mar 21 20:00:36 2009