summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-08-11 20:53:28 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-08-11 20:53:28 +0200
commitf7f0d6c7560a8f71707e7852a512469147aa9f84 (patch)
tree5bec681b4e798a2b35bea180213df399c51920d9 /methods
parentdd6882853b4555a6113740afca417acbaa060043 (diff)
cppcheck complains about some possible speed improvements which could be
done on the mirco-optimazation level, so lets fix them: (performance) Possible inefficient checking for emptiness. (performance) Prefer prefix ++/-- operators for non-primitive types.
Diffstat (limited to 'methods')
-rw-r--r--methods/ftp.cc2
-rw-r--r--methods/gpgv.cc6
-rw-r--r--methods/http.cc6
-rw-r--r--methods/mirror.cc4
4 files changed, 9 insertions, 9 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc
index 97248f900..c2c485769 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -559,7 +559,7 @@ bool FTPConn::ExtGoPasv()
string::const_iterator List[4];
unsigned Count = 0;
Pos++;
- for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); I++)
+ for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); ++I)
{
if (*I != Msg[Pos])
continue;
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index 960c06180..3ad3e8d84 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -213,21 +213,21 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
{
errmsg += _("The following signatures were invalid:\n");
for (vector<string>::iterator I = BadSigners.begin();
- I != BadSigners.end(); I++)
+ I != BadSigners.end(); ++I)
errmsg += (*I + "\n");
}
if (!WorthlessSigners.empty())
{
errmsg += _("The following signatures were invalid:\n");
for (vector<string>::iterator I = WorthlessSigners.begin();
- I != WorthlessSigners.end(); I++)
+ I != WorthlessSigners.end(); ++I)
errmsg += (*I + "\n");
}
if (!NoPubKeySigners.empty())
{
errmsg += _("The following signatures couldn't be verified because the public key is not available:\n");
for (vector<string>::iterator I = NoPubKeySigners.begin();
- I != NoPubKeySigners.end(); I++)
+ I != NoPubKeySigners.end(); ++I)
errmsg += (*I + "\n");
}
}
diff --git a/methods/http.cc b/methods/http.cc
index 13f9cbe06..65a0cbbb7 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -402,10 +402,10 @@ ServerState::RunHeadersResult ServerState::RunHeaders()
if (Debug == true)
clog << Data;
- for (string::const_iterator I = Data.begin(); I < Data.end(); I++)
+ for (string::const_iterator I = Data.begin(); I < Data.end(); ++I)
{
string::const_iterator J = I;
- for (; J != Data.end() && *J != '\n' && *J != '\r';J++);
+ for (; J != Data.end() && *J != '\n' && *J != '\r'; ++J);
if (HeaderLine(string(I,J)) == false)
return RUN_HEADERS_PARSE_ERROR;
I = J;
@@ -1325,7 +1325,7 @@ int HttpMethod::Loop()
StopRedirects = true;
else
{
- for (StringVectorIterator I = R.begin(); I != R.end(); I++)
+ for (StringVectorIterator I = R.begin(); I != R.end(); ++I)
if (Queue->Uri == *I)
{
R[0] = "STOP";
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 713dc211a..565df5327 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -107,7 +107,7 @@ bool MirrorMethod::Clean(string Dir)
continue;
// see if we have that uri
- for(I=list.begin(); I != list.end(); I++)
+ for(I=list.begin(); I != list.end(); ++I)
{
string uri = (*I)->GetURI();
if(uri.find("mirror://") != 0)
@@ -330,7 +330,7 @@ string MirrorMethod::GetMirrorFileName(string mirror_uri_str)
vector<metaIndex *>::const_iterator I;
pkgSourceList list;
list.ReadMainList();
- for(I=list.begin(); I != list.end(); I++)
+ for(I=list.begin(); I != list.end(); ++I)
{
string uristr = (*I)->GetURI();
if(Debug)