mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 19:58:53 +00:00
Modernize std::binary_search
with ranges
In VolumeVerifier.cpp, constructing a `std::string_view` of the volume's GameID is unnecessary, as `std::`(`ranges::`)`binary_search` supports heterogeneous lookup. The usage in GameFile.cpp is a perfect example.
This commit is contained in:
parent
01d0bdf1bb
commit
728663bdc0
3 changed files with 4 additions and 8 deletions
|
@ -616,8 +616,7 @@ bool GameFile::CheckIfTwoDiscGame(const std::string& game_id) const
|
|||
static_assert(std::ranges::is_sorted(two_disc_game_id_prefixes));
|
||||
|
||||
std::string_view game_id_prefix(game_id.data(), GAME_ID_PREFIX_SIZE);
|
||||
return std::binary_search(two_disc_game_id_prefixes.begin(), two_disc_game_id_prefixes.end(),
|
||||
game_id_prefix);
|
||||
return std::ranges::binary_search(two_disc_game_id_prefixes, game_id_prefix);
|
||||
}
|
||||
|
||||
std::string GameFile::GetNetPlayName(const Core::TitleDatabase& title_database) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue