]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/aptconfiguration.cc
cppcheck complains about some possible speed improvements which could be
[apt.git] / apt-pkg / aptconfiguration.cc
index 14ee09e0d2ea7c5c34e6d5b6af02f5465a011edc..6ec5fa03a5d4f42113daf75864c3c8a6c1efa961 100644 (file)
@@ -53,7 +53,7 @@ const Configuration::getCompressionTypes(bool const &Cached) {
        // load the order setting into our vector
        std::vector<std::string> const order = _config->FindVector("Acquire::CompressionTypes::Order");
        for (std::vector<std::string>::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
@@ -224,7 +224,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
                environment.push_back("en");
        }
 
-       // Support settings like Acquire::Translation=none on the command line to
+       // Support settings like Acquire::Languages=none on the command line to
        // override the configuration settings vector of languages.
        string const forceLang = _config->Find("Acquire::Languages","");
        if (forceLang.empty() == false) {
@@ -274,7 +274,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
        // then needed and ensure the codes are not listed twice.
        bool noneSeen = false;
        for (std::vector<string>::const_iterator l = lang.begin();
-            l != lang.end(); l++) {
+            l != lang.end(); ++l) {
                if (*l == "environment") {
                        for (std::vector<string>::const_iterator e = environment.begin();
                             e != environment.end(); ++e) {
@@ -337,7 +337,7 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache
                                char* arch = strtok(buf, " ");
                                while (arch != NULL) {
                                        for (; isspace(*arch) != 0; ++arch);
-                                       if (arch != '\0') {
+                                       if (arch[0] != '\0') {
                                                char const* archend = arch;
                                                for (; isspace(*archend) == 0 && *archend != '\0'; ++archend);
                                                archs.push_back(string(arch, (archend - arch)));
@@ -352,7 +352,7 @@ std::vector<std::string> 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<string>::reverse_iterator a = archs.rbegin();