summaryrefslogtreecommitdiff
path: root/apt-pkg/policy.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-06-04 18:14:13 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2017-06-26 23:31:15 +0200
commitfc2055e1e08e4e3b662b0c5f67a0d0a57267acd3 (patch)
treebf071ffd9f1beb27847ec62d7186e7f2902cad41 /apt-pkg/policy.cc
parentd0eb158be03f15139eee65c4162c9c6e3be10718 (diff)
avoid explicit types for pkg counts by auto
Changes nothing on the program front and as the datatypes are sufficently comparable fixes no bug either, but problems later on if we ever change the types of those and prevent us using types which are too large for the values we want to store waste (a tiny bit of) resources. Gbp-Dch: Ignore
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r--apt-pkg/policy.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 3dd6ddac4..e87ba3ee2 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -50,12 +50,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.