diff options
| author | Maxime Coste <mawww@kakoune.org> | 2025-02-19 22:08:11 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2025-02-19 23:02:03 +1100 |
| commit | b3f95ee69b4cf8b5ad643647f96adb5cdf0f3997 (patch) | |
| tree | a8b2020dbfdd1088913f7a08f3a4716c7cc7e82f /src | |
| parent | f910d6cb657ff39df5c536929e4146f88acda93f (diff) | |
Slight style tweaks
Diffstat (limited to 'src')
| -rw-r--r-- | src/completion.cc | 8 | ||||
| -rw-r--r-- | src/utils.hh | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/completion.cc b/src/completion.cc index d1e10f08..1544f6a7 100644 --- a/src/completion.cc +++ b/src/completion.cc @@ -70,9 +70,7 @@ CandidateList complete_command(StringView prefix, ByteCount cursor_pos) { Vector<String> files; list_files(dirname, [&](StringView filename, const struct stat& st) { - bool executable = (st.st_mode & S_IXUSR) - | (st.st_mode & S_IXGRP) - | (st.st_mode & S_IXOTH); + bool executable = st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH); if (S_ISDIR(st.st_mode) or (S_ISREG(st.st_mode) and executable)) files.push_back(filename.str()); }); @@ -109,9 +107,7 @@ CandidateList complete_command(StringView prefix, ByteCount cursor_pos) { cache.commands.clear(); list_files(dirname, [&](StringView filename, const struct stat& st) { - bool executable = (st.st_mode & S_IXUSR) - | (st.st_mode & S_IXGRP) - | (st.st_mode & S_IXOTH); + bool executable = st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH); if (S_ISREG(st.st_mode) and executable) cache.commands.push_back(filename.str()); }); diff --git a/src/utils.hh b/src/utils.hh index 7b7fd2d7..4b84ce75 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -73,7 +73,7 @@ public: { other.m_valid = false; } [[gnu::always_inline]] - ~OnScopeEnd() noexcept(noexcept(std::declval<T>()())) { if (m_valid) m_func(); } + ~OnScopeEnd() noexcept(noexcept(m_func())) { if (m_valid) m_func(); } private: bool m_valid; |
