diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-02-28 16:04:52 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-02-28 16:04:52 +0000 |
| commit | 72e475dfdeaa4a87dff0eef994e7814e94c40363 (patch) | |
| tree | 94a84e90c14876db223e4a733f651fe0b034f5e9 /src/HttpConnection.cc | |
| parent | c342bde9627b434effbc0cd10b817670d1da0923 (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/HttpConnection.cc')
| -rw-r--r-- | src/HttpConnection.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/HttpConnection.cc b/src/HttpConnection.cc index 7e723fab..2c8d0176 100644 --- a/src/HttpConnection.cc +++ b/src/HttpConnection.cc @@ -152,8 +152,8 @@ SharedHandle<HttpResponse> HttpConnection::receiveResponse() bool HttpConnection::isIssued(const SharedHandle<Segment>& segment) const { - for(HttpRequestEntries::const_iterator itr = outstandingHttpRequests.begin(); - itr != outstandingHttpRequests.end(); ++itr) { + for(HttpRequestEntries::const_iterator itr = outstandingHttpRequests.begin(), + eoi = outstandingHttpRequests.end(); itr != eoi; ++itr) { SharedHandle<HttpRequest> httpRequest = (*itr)->getHttpRequest(); if(httpRequest->getSegment() == segment) { return true; |
