mail[Wesnoth-commits] r33992 - in /trunk/src: config_cache.cpp config_cache.hpp


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:52 2009
New Revision: 33992

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

Modified:
    trunk/src/config_cache.cpp
    trunk/src/config_cache.hpp

Modified: trunk/src/config_cache.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config_cache.cpp?rev=33992&r1=33991&r2=33992&view=diff
==============================================================================
--- trunk/src/config_cache.cpp (original)
+++ trunk/src/config_cache.cpp Sat Mar 21 19:44:52 2009
@@ -274,8 +274,9 @@
 
                // use static preproc_define::read_pair(config*) to make a 
object
                // and pass that object 
config_cache_transaction::insert_to_active method
-               std::for_each(cfg.ordered_begin(), cfg.ordered_end(),
-                               add_define_from_file());
+               foreach (const config::any_child &value, 
cfg.all_children_range()) {
+                       preproc_define::read_pair(&value.cfg);
+               }
        }
 
        void config_cache::read_defines_queue()

Modified: trunk/src/config_cache.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config_cache.hpp?rev=33992&r1=33991&r2=33992&view=diff
==============================================================================
--- trunk/src/config_cache.hpp (original)
+++ trunk/src/config_cache.hpp Sat Mar 21 19:44:52 2009
@@ -182,7 +182,6 @@
 
        };
 
-       struct add_define_from_file;
        class fake_transaction;
        /**
         * Used to share macros between cache objects
@@ -226,22 +225,12 @@
                static config_cache_transaction& instance()
                { assert(active_); return *active_; }
                friend class config_cache;
-               friend struct add_define_from_file;
                friend class fake_transaction;
                const filenames& get_define_files() const;
                void add_define_file(const std::string&);
                preproc_map& get_active_map(const preproc_map&);
                void add_defines_map_diff(preproc_map& defines_map);
        };
-
-       struct add_define_from_file {
-               void operator()(const 
config::all_children_iterator::value_type& value) const
-               {
-                       config_cache_transaction::instance().insert_to_active(
-                                       
preproc_define::read_pair(value.second));
-               }
-       };
-
 
        /**
         * Holds a fake cache transaction if no real one is used




Related Messages


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