From: Martin Vidner Date: Fri, 6 Dec 2019 12:48:18 +0000 (+0100) Subject: Use range-based-for X-Git-Tag: v0.8.7^2~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58d77bf028be9db4a57953dc6e297eab97074846;p=thirdparty%2Fsnapper.git Use range-based-for --- diff --git a/zypp-plugin/snapper_zypp_plugin.cc b/zypp-plugin/snapper_zypp_plugin.cc index 7d5b1946..decacfd7 100644 --- a/zypp-plugin/snapper_zypp_plugin.cc +++ b/zypp-plugin/snapper_zypp_plugin.cc @@ -29,7 +29,7 @@ using snapper::CodeLocation; ostream& operator <<(ostream& os, set 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 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; }