From 69c2ecbdc937e3c73fe67d3c9bce12a80d3ec7ec Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 10 Mar 2013 12:24:13 +0100 Subject: various simple changes to fix cppcheck warnings --- apt-pkg/srcrecords.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'apt-pkg/srcrecords.cc') 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]; } /*}}}*/ -- cgit v1.2.3