Author: ilor
Date: Sat Jun 14 12:55:39 2008
New Revision: 27164

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27164&view=rev
Log:
add an add_attribute function to config -- should be faster than using 
operator[] and assignment. Not used anywhere yet, but a good candidate for 
places that create configs a lot.

Modified:
    trunk/src/config.hpp

Modified: trunk/src/config.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config.hpp?rev=27164&r1=27163&r2=27164&view=diff
==============================================================================
--- trunk/src/config.hpp (original)
+++ trunk/src/config.hpp Sat Jun 14 12:55:39 2008
@@ -79,6 +79,9 @@
 
        const t_string& get_attribute(const std::string& key) const;
        bool has_attribute(const std::string& key) const {return 
values.find(key) != values.end();}
+       bool add_attribute(const std::string& key, const t_string& value) {
+               return values.insert(string_map::value_type(key, value)).second;
+       }
 
        config* find_child(const std::string& key, const std::string& name,
                           const t_string& value);


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to