]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- coding style 673/head
authorArvin Schnell <aschnell@suse.de>
Tue, 5 Oct 2021 12:02:37 +0000 (14:02 +0200)
committerArvin Schnell <aschnell@suse.de>
Tue, 5 Oct 2021 12:02:37 +0000 (14:02 +0200)
snapper/Enum.cc
snapper/Filesystem.cc
snapper/SnapperTmpl.h

index 0fdd454cbed243d4a30e256a8080edb32d75c034..22b7f31d88305d75a1272a006a43c2d748b1505e 100644 (file)
 namespace snapper
 {
 
-    static const string snapshot_type_names[] = {
+    const vector<string> EnumInfo<SnapshotType>::names({
        "single", "pre", "post"
-    };
-
-    const vector<string> EnumInfo<SnapshotType>::names(snapshot_type_names, snapshot_type_names +
-                                                      lengthof(snapshot_type_names));
+    });
 
 }
index c01961ab5b7997b896e71953f8adfeefa8943893..52ca97fae892362cc404af6d08f3712171300ddc 100644 (file)
@@ -57,7 +57,7 @@ namespace snapper
     vector<string>
     Filesystem::filter_mount_options(const vector<string>& options)
     {
-       static const char* ign_opt[] = {
+       static const char* ign_opts[] = {
            "ro", "rw",
            "exec", "noexec", "suid", "nosuid", "dev", "nodev",
            "atime", "noatime", "diratime", "nodiratime",
@@ -66,8 +66,8 @@ namespace snapper
 
        vector<string> ret = options;
 
-       for (size_t i = 0; i < lengthof(ign_opt); ++i)
-           ret.erase(remove(ret.begin(), ret.end(), ign_opt[i]), ret.end());
+       for (const char* ign_opt : ign_opts)
+           ret.erase(remove(ret.begin(), ret.end(), ign_opt), ret.end());
 
        return ret;
     }
index eab0e88aa048a245133f7620a62052af52772ae1..8707af56bf7d8c2778d9660a9dab9225257a8a77 100644 (file)
@@ -116,10 +116,6 @@ namespace snapper
        return find_if(l.begin(), l.end(), pred) != l.end();
     }
 
-
-    template <class T, unsigned int sz>
-    inline unsigned int lengthof(T (&)[sz]) { return sz; }
-
 }
 
 #endif