From 72e475dfdeaa4a87dff0eef994e7814e94c40363 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 28 Feb 2010 16:04:52 +0000 Subject: 2010-03-01 Tatsuhiro Tsujikawa 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. --- src/FeatureConfig.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/FeatureConfig.cc') diff --git a/src/FeatureConfig.cc b/src/FeatureConfig.cc index 35065528..66dfcf23 100644 --- a/src/FeatureConfig.cc +++ b/src/FeatureConfig.cc @@ -151,8 +151,8 @@ bool FeatureConfig::isSupported(const std::string& feature) const std::string FeatureConfig::featureSummary() const { std::string s; - for(FeatureMap::const_iterator i = _features.begin(); - i != _features.end(); ++i) { + for(FeatureMap::const_iterator i = _features.begin(), eoi = _features.end(); + i != eoi; ++i) { if((*i).second) { s += (*i).first; s += ", "; -- cgit