mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 20:28:56 +00:00
Modernize std::none_of
with ranges
In JitRegCache.cpp, the lambda predicate were replaced by a pointer to member function because ranges algorithms are able to invoke those. In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates. In BoundingBox.cpp, the lambda predicate was returning the bool element unchanged, so `std::identity` was a better fit.
This commit is contained in:
parent
140252ffc0
commit
2b0cd16c8c
7 changed files with 20 additions and 27 deletions
|
@ -138,10 +138,9 @@ void GraphicsModListWidget::RefreshModList()
|
|||
for (const GraphicsModConfig& mod : m_mod_group.GetMods())
|
||||
{
|
||||
// If no group matches the mod's features, or if the mod has no features, skip it
|
||||
if (std::none_of(mod.m_features.begin(), mod.m_features.end(),
|
||||
[&groups](const GraphicsModFeatureConfig& feature) {
|
||||
return groups.contains(feature.m_group);
|
||||
}))
|
||||
if (std::ranges::none_of(mod.m_features, [&groups](const GraphicsModFeatureConfig& feature) {
|
||||
return groups.contains(feature.m_group);
|
||||
}))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -248,9 +248,8 @@ void ConvertDialog::OnFormatChanged()
|
|||
m_compression->setEnabled(m_compression->count() > 1);
|
||||
|
||||
// Block scrubbing of RVZ containers and Datel discs
|
||||
const bool scrubbing_allowed =
|
||||
format != DiscIO::BlobType::RVZ &&
|
||||
std::none_of(m_files.begin(), m_files.end(), std::mem_fn(&UICommon::GameFile::IsDatelDisc));
|
||||
const bool scrubbing_allowed = format != DiscIO::BlobType::RVZ &&
|
||||
std::ranges::none_of(m_files, &UICommon::GameFile::IsDatelDisc);
|
||||
|
||||
m_scrub->setEnabled(scrubbing_allowed);
|
||||
if (!scrubbing_allowed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue