mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Modernize std::find_if
with ranges
In BTEmu.cpp, `std::mem_fn` was not necessary for the predicate to compile.
This commit is contained in:
@ -84,8 +84,8 @@ SectorReader::~SectorReader()
|
||||
|
||||
const SectorReader::Cache* SectorReader::FindCacheLine(u64 block_num)
|
||||
{
|
||||
auto itr = std::find_if(m_cache.begin(), m_cache.end(),
|
||||
[&](const Cache& entry) { return entry.Contains(block_num); });
|
||||
auto itr =
|
||||
std::ranges::find_if(m_cache, [&](const Cache& entry) { return entry.Contains(block_num); });
|
||||
if (itr == m_cache.end())
|
||||
return nullptr;
|
||||
|
||||
|
@ -366,7 +366,7 @@ static FSTBuilderNode* FindFileNodeInFST(std::string_view path, std::vector<FSTB
|
||||
const size_t path_separator = path.find('/');
|
||||
const bool is_file = path_separator == std::string_view::npos;
|
||||
const std::string_view name = is_file ? path : path.substr(0, path_separator);
|
||||
const auto it = std::find_if(fst->begin(), fst->end(), [&](const FSTBuilderNode& node) {
|
||||
const auto it = std::ranges::find_if(*fst, [&](const FSTBuilderNode& node) {
|
||||
return Common::CaseInsensitiveEquals(node.m_filename, name);
|
||||
});
|
||||
|
||||
|
@ -472,8 +472,7 @@ std::vector<Partition> VolumeVerifier::CheckPartitions()
|
||||
AddProblem(Severity::High, Common::GetStringT("The install partition is missing."));
|
||||
|
||||
if (ShouldHaveMasterpiecePartitions() &&
|
||||
types.cend() ==
|
||||
std::find_if(types.cbegin(), types.cend(), [](u32 type) { return type >= 0xFF; }))
|
||||
types.cend() == std::ranges::find_if(types, [](u32 type) { return type >= 0xFF; }))
|
||||
{
|
||||
// i18n: This string is referring to a game mode in Super Smash Bros. Brawl called Masterpieces
|
||||
// where you play demos of NES/SNES/N64 games. Official translations:
|
||||
|
Reference in New Issue
Block a user