mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 04:50:31 -04:00
refactor(universal): simplify looks_like_executable
This commit is contained in:
parent
9a736f2ab2
commit
7aded55c09
@ -52,19 +52,12 @@ constexpr dwarfs::sorted_array_map functions{
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool looks_like_executable(std::filesystem::path const& path) {
|
bool looks_like_executable(std::filesystem::path const& path) {
|
||||||
auto ext = path.extension().string();
|
auto const ext = path.extension().string();
|
||||||
|
return ext.empty()
|
||||||
if (ext.empty()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (ext == ".exe") {
|
|| ext == ".exe"
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user