// SrcRecords::pkgSrcRecords - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* Open all the source index files */
-pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0)
+pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : d(NULL), Files(0), Current(0)
{
for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); ++I)
{
}
// 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"));
/* */
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];
}
/*}}}*/