]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- coding style 595/head
authorArvin Schnell <aschnell@suse.de>
Wed, 18 Nov 2020 12:07:39 +0000 (13:07 +0100)
committerArvin Schnell <aschnell@suse.de>
Wed, 18 Nov 2020 12:07:39 +0000 (13:07 +0100)
client/cmd-list-configs.cc
client/cmd-list.cc
zypp-plugin/snapper_zypp_plugin.cc

index 5c20008d8b7c55167af59fb40080a529230350f7..52ab28a798ca300a5acbed891cc11477bc2cad06 100644 (file)
@@ -103,7 +103,7 @@ namespace snapper
                formatter.header().push_back(header_for(column));
 
            map<string, ProxyConfig> configs = snappers->getConfigs();
-           for (const map<string, ProxyConfig>::value_type value : configs)
+           for (const map<string, ProxyConfig>::value_type& value : configs)
            {
                vector<string> row;
 
@@ -126,7 +126,7 @@ namespace snapper
                formatter.header().push_back(toString(column));
 
            map<string, ProxyConfig> configs = snappers->getConfigs();
-           for (const map<string, ProxyConfig>::value_type value : configs)
+           for (const map<string, ProxyConfig>::value_type& value : configs)
            {
                vector<string> row;
 
@@ -149,7 +149,7 @@ namespace snapper
            json_object_object_add(formatter.root(), "configs", json_configs);
 
            map<string, ProxyConfig> configs = snappers->getConfigs();
-           for (const map<string, ProxyConfig>::value_type value : configs)
+           for (const map<string, ProxyConfig>::value_type& value : configs)
            {
                json_object* json_config = json_object_new_object();
                json_object_array_add(json_configs, json_config);
index 3ff10e59c9cec9df97db1b476feff01b6e90d636..9ec872ea80c37cd569f0e17cdb2ee680e44df498 100644 (file)
@@ -510,7 +510,7 @@ namespace snapper
                    return nullptr;
 
                json_object* json_userdata = json_object_new_object();
-               for (const map<string, string>::value_type sub_value : tmp)
+               for (const map<string, string>::value_type& sub_value : tmp)
                    json_object_object_add(json_userdata, sub_value.first.c_str(),
                                           json_object_new_string(sub_value.second.c_str()));
 
index 238a196cbad366966109d82033dfafb145d2c49f..e4b0c0aff472d8bc10770942a8c01324495e722f 100644 (file)
@@ -50,13 +50,16 @@ using snapper::CodeLocation;
 #include "zypp_commit_plugin.h"
 #include "solvable_matcher.h"
 
-ostream& operator <<(ostream& os, set<string> ss) {
+ostream&
+operator<<(ostream& os, const set<string>& ss)
+{
     bool seen_first = false;
     os << '{';
-    for (auto s: ss) {
-       if (seen_first) {
+    for (auto s : ss)
+    {
+       if (seen_first)
            os << ", ";
-       }
+
        os << s;
        seen_first = true;
     }
@@ -81,22 +84,19 @@ public:
     , snapper_config("root")
     , bus(DBUS_BUS_SYSTEM)
     {
-       const char * s;
+       const char* s;
 
        s = getenv("SNAPPER_ZYPP_PLUGIN_CONFIG");
-       if (s != nullptr) {
+       if (s)
            plugin_config = s;
-       }
 
        s = getenv("SNAPPER_ZYPP_PLUGIN_SNAPPER_CONFIG");
-       if (s != nullptr) {
+       if (s)
            snapper_config = s;
-       }
 
        s = getenv("SNAPPER_ZYPP_PLUGIN_DBUS_SESSION");
-       if (s != nullptr) {
+       if (s)
            bus = DBUS_BUS_SESSION;
-       }
     }
 };