summaryrefslogtreecommitdiff
path: root/src/ServerStatMan.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-02-28 16:04:52 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-02-28 16:04:52 +0000
commit72e475dfdeaa4a87dff0eef994e7814e94c40363 (patch)
tree94a84e90c14876db223e4a733f651fe0b034f5e9 /src/ServerStatMan.cc
parentc342bde9627b434effbc0cd10b817670d1da0923 (diff)
2010-03-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Avoid to calculate end() iterator in each loop. std::deque is particularly slow. Make sure that recalculate end iterator if element is erased during loop.
Diffstat (limited to 'src/ServerStatMan.cc')
-rw-r--r--src/ServerStatMan.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ServerStatMan.cc b/src/ServerStatMan.cc
index ba403420..8e90f323 100644
--- a/src/ServerStatMan.cc
+++ b/src/ServerStatMan.cc
@@ -105,8 +105,8 @@ bool ServerStatMan::load(std::istream& in)
std::vector<std::string> items;
util::split(line, std::back_inserter(items), ",");
std::map<std::string, std::string> m;
- for(std::vector<std::string>::const_iterator i = items.begin();
- i != items.end(); ++i) {
+ for(std::vector<std::string>::const_iterator i = items.begin(),
+ eoi = items.end(); i != eoi; ++i) {
std::pair<std::string, std::string> p = util::split(*i, "=");
util::trimSelf(p.first);
util::trimSelf(p.second);