mail[Wesnoth-commits] r20176 - /trunk/src/help.cpp


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

Header


Content

Posted by alinktomine on September 07, 2007 - 17:10:
Author: alink
Date: Fri Sep  7 17:09:31 2007
New Revision: 20176

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20176&view=rev
Log:
In help, use reference for unit_type, this make the units parsing 
instantaneous
and make the global help load ~3 times faster here (with all units).
(the bottleneck is now again the bad unit_type.attacks(). So I will probably
finish to clean it)

Modified:
    trunk/src/help.cpp

Modified: trunk/src/help.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/help.cpp?rev=20176&r1=20175&r2=20176&view=diff
==============================================================================
--- trunk/src/help.cpp (original)
+++ trunk/src/help.cpp Fri Sep  7 17:09:31 2007
@@ -1163,13 +1163,13 @@
 
 class unit_topic_generator: public topic_generator
 {
-       unit_type type_;
+       const unit_type& type_;
        typedef std::pair< std::string, unsigned > item;
        void push_header(std::vector< item > &row, char const *name) const {
                row.push_back(item(bold(name), font::line_width(name, 
normal_font_size, TTF_STYLE_BOLD)));
        }
 public:
-       unit_topic_generator(unit_type const &t): type_(t) {}
+       unit_topic_generator(const unit_type &t): type_(t) {}
        virtual std::string operator()() const {
                std::stringstream ss;
                std::string clear_stringstream;




Related Messages


Powered by MHonArc, Updated Fri Sep 07 19:00:23 2007