mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
apply if constexpr
in a couple places
This commit is contained in:
parent
ccbc4c2d99
commit
181e0dba21
@ -125,9 +125,11 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& directorie
|
|||||||
// std::filesystem uses the OS separator.
|
// std::filesystem uses the OS separator.
|
||||||
constexpr fs::path::value_type os_separator = fs::path::preferred_separator;
|
constexpr fs::path::value_type os_separator = fs::path::preferred_separator;
|
||||||
static_assert(os_separator == DIR_SEP_CHR || os_separator == '\\', "Unsupported path separator");
|
static_assert(os_separator == DIR_SEP_CHR || os_separator == '\\', "Unsupported path separator");
|
||||||
if (os_separator != DIR_SEP_CHR)
|
if constexpr (os_separator != DIR_SEP_CHR)
|
||||||
|
{
|
||||||
for (auto& path : result)
|
for (auto& path : result)
|
||||||
std::replace(path.begin(), path.end(), '\\', DIR_SEP_CHR);
|
std::replace(path.begin(), path.end(), '\\', DIR_SEP_CHR);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ bool SDCardCreate(u64 disk_size /*in MB*/, const std::string& filename)
|
|||||||
if (!write_sector(file, s_fsinfo_sector))
|
if (!write_sector(file, s_fsinfo_sector))
|
||||||
goto FailWrite;
|
goto FailWrite;
|
||||||
|
|
||||||
if (BACKUP_BOOT_SECTOR > 0)
|
if constexpr (BACKUP_BOOT_SECTOR > 0)
|
||||||
{
|
{
|
||||||
if (!write_empty(file, BACKUP_BOOT_SECTOR - 2))
|
if (!write_empty(file, BACKUP_BOOT_SECTOR - 2))
|
||||||
goto FailWrite;
|
goto FailWrite;
|
||||||
|
Loading…
Reference in New Issue
Block a user