]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
Use range-based-for
authorMartin Vidner <mvidner@suse.cz>
Fri, 6 Dec 2019 12:48:18 +0000 (13:48 +0100)
committerMartin Vidner <mvidner@suse.cz>
Fri, 13 Dec 2019 15:31:47 +0000 (16:31 +0100)
zypp-plugin/snapper_zypp_plugin.cc

index 7d5b1946c3ab61857820621a5fe6633e5d326704..decacfd7eff0f6b6fd5ac145165ef674e8c86364 100644 (file)
@@ -29,7 +29,7 @@ using snapper::CodeLocation;
 ostream& operator <<(ostream& os, set<string> ss) {
     bool seen_first = false;
     os << '{';
-    for(auto s: ss) {
+    for (auto s: ss) {
        if (seen_first) {
            os << ", ";
        }
@@ -81,7 +81,7 @@ public:
        Kind kind;
        bool important;
 
-       SolvableMatcher(string apattern, Kind akind, bool aimportant)
+       SolvableMatcher(const string& apattern, Kind akind, bool aimportant)
        : pattern(apattern)
        , kind(akind)
        , important(aimportant)
@@ -111,15 +111,15 @@ public:
            const xmlNode* root = config.getRootElement();
            const xmlNode* solvables_n = getChildNode(root, "solvables");
            const list<const xmlNode*> solvables_l = getChildNodes(solvables_n, "solvable");
-           for (auto it = solvables_l.begin(); it != solvables_l.end(); ++it) {
+           for (auto node: solvables_l) {
                string pattern;
                Kind kind;
                bool important = false;
 
-               getAttributeValue(*it, "important", important);
+               getAttributeValue(node, "important", important);
                string kind_s;
-               getAttributeValue(*it, "match", kind_s);
-               getValue(*it, pattern);
+               getAttributeValue(node, "match", kind_s);
+               getValue(node, pattern);
                if (kind_s == "w") { // w for wildcard
                    kind = Kind::GLOB;
                }