summaryrefslogtreecommitdiff
path: root/apt-pkg/srcrecords.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-03-10 12:24:13 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-03-10 12:24:13 +0100
commit69c2ecbdc937e3c73fe67d3c9bce12a80d3ec7ec (patch)
treeb3b8f0753ebe2760ab8d97b0e9404ddbeef25a1b /apt-pkg/srcrecords.cc
parentfd6a8d0ddc14406bb6c0996b5bbaa95d6ccc1186 (diff)
various simple changes to fix cppcheck warnings
Diffstat (limited to 'apt-pkg/srcrecords.cc')
-rw-r--r--apt-pkg/srcrecords.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
index d63d2c422..297559957 100644
--- a/apt-pkg/srcrecords.cc
+++ b/apt-pkg/srcrecords.cc
@@ -42,7 +42,7 @@ pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : d(NULL), Files(0), Current(0
}
// Doesn't work without any source index files
- if (Files.size() == 0)
+ if (Files.empty() == true)
{
_error->Error(_("You must put some 'source' URIs"
" in your sources.list"));
@@ -121,14 +121,13 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool const &SrcOn
/* */
const char *pkgSrcRecords::Parser::BuildDepType(unsigned char const &Type)
{
- const char *fields[] = {"Build-Depends",
- "Build-Depends-Indep",
+ const char *fields[] = {"Build-Depends",
+ "Build-Depends-Indep",
"Build-Conflicts",
"Build-Conflicts-Indep"};
- if (Type < 4)
- return fields[Type];
- else
+ if (unlikely(Type >= sizeof(fields)/sizeof(fields[0])))
return "";
+ return fields[Type];
}
/*}}}*/