Skip to content

Commit

Permalink
Merge pull request openSUSE#673 from aschnell/master
Browse files Browse the repository at this point in the history
- coding style
  • Loading branch information
aschnell authored Oct 5, 2021
2 parents da01cd9 + 7d81f9a commit dece843
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
7 changes: 2 additions & 5 deletions snapper/Enum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@
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));
});

}
6 changes: 3 additions & 3 deletions snapper/Filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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;
}
Expand Down
4 changes: 0 additions & 4 deletions snapper/SnapperTmpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dece843

Please sign in to comment.