From bd9d81e3d793b9fb5c94fd5ad0b00245205b8cbc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 25 Jul 2011 12:37:06 +0200 Subject: * apt-pkg/aptconfiguration.cc: - ensure that native architecture is if not specified otherwise the first architecture in the Architectures vector --- apt-pkg/aptconfiguration.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/aptconfiguration.cc') diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index e8c8e73d0..9ccbeecf1 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -352,7 +352,7 @@ std::vector const Configuration::getArchitectures(bool const &Cache if (archs.empty() == true || std::find(archs.begin(), archs.end(), arch) == archs.end()) - archs.push_back(arch); + archs.insert(archs.begin(), arch); // erase duplicates and empty strings for (std::vector::reverse_iterator a = archs.rbegin(); -- cgit v1.2.3 From f7f0d6c7560a8f71707e7852a512469147aa9f84 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 11 Aug 2011 20:53:28 +0200 Subject: cppcheck complains about some possible speed improvements which could be done on the mirco-optimazation level, so lets fix them: (performance) Possible inefficient checking for emptiness. (performance) Prefer prefix ++/-- operators for non-primitive types. --- apt-pkg/aptconfiguration.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/aptconfiguration.cc') diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 9ccbeecf1..6ec5fa03a 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -53,7 +53,7 @@ const Configuration::getCompressionTypes(bool const &Cached) { // load the order setting into our vector std::vector const order = _config->FindVector("Acquire::CompressionTypes::Order"); for (std::vector::const_iterator o = order.begin(); - o != order.end(); o++) { + o != order.end(); ++o) { if ((*o).empty() == true) continue; // ignore types we have no method ready to use @@ -274,7 +274,7 @@ std::vector const Configuration::getLanguages(bool const &All, // then needed and ensure the codes are not listed twice. bool noneSeen = false; for (std::vector::const_iterator l = lang.begin(); - l != lang.end(); l++) { + l != lang.end(); ++l) { if (*l == "environment") { for (std::vector::const_iterator e = environment.begin(); e != environment.end(); ++e) { -- cgit v1.2.3