summaryrefslogtreecommitdiff
path: root/src/HttpRequestCommand.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/HttpRequestCommand.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/HttpRequestCommand.cc')
-rw-r--r--src/HttpRequestCommand.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc
index 5bf996bd..39f6f17c 100644
--- a/src/HttpRequestCommand.cc
+++ b/src/HttpRequestCommand.cc
@@ -134,8 +134,8 @@ bool HttpRequestCommand::executeInternal() {
_proxyRequest));
_httpConnection->sendRequest(httpRequest);
} else {
- for(std::vector<SharedHandle<Segment> >::iterator itr = _segments.begin();
- itr != _segments.end(); ++itr) {
+ for(std::vector<SharedHandle<Segment> >::const_iterator itr =
+ _segments.begin(), eoi = _segments.end(); itr != eoi; ++itr) {
const SharedHandle<Segment>& segment = *itr;
if(!_httpConnection->isIssued(segment)) {
SharedHandle<HttpRequest> httpRequest