summaryrefslogtreecommitdiff
path: root/apt-pkg/policy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r--apt-pkg/policy.cc31
1 files changed, 16 insertions, 15 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 3dd6ddac4..008c98ecb 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -13,27 +13,26 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/policy.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cachefilter.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/fileutl.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/versionmatch.h>
+#include <apt-pkg/policy.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/tagfile.h>
#include <apt-pkg/version.h>
+#include <apt-pkg/versionmatch.h>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <vector>
#include <ctype.h>
#include <stddef.h>
#include <string.h>
-#include <string>
-#include <vector>
-#include <iostream>
-#include <sstream>
#include <apti18n.h>
/*}}}*/
@@ -50,12 +49,14 @@ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(nullptr), VerPins(nullptr),
if (Owner == 0)
return;
PFPriority = new signed short[Owner->Head().PackageFileCount];
- Pins = new Pin[Owner->Head().PackageCount];
+ auto PackageCount = Owner->Head().PackageCount;
+ Pins = new Pin[PackageCount];
VerPins = new Pin[Owner->Head().VersionCount];
- for (unsigned long I = 0; I != Owner->Head().PackageCount; I++)
+ for (decltype(PackageCount) I = 0; I != PackageCount; ++I)
Pins[I].Type = pkgVersionMatch::None;
- for (unsigned long I = 0; I != Owner->Head().VersionCount; I++)
+ auto VersionCount = Owner->Head().VersionCount;
+ for (decltype(VersionCount) I = 0; I != VersionCount; ++I)
VerPins[I].Type = pkgVersionMatch::None;
// The config file has a master override.