mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-17 15:51:40 +00:00
Merge pull request #13116 from mitaclaw/ranges-modernization-8-trivial-of
Ranges Algorithms Modernization - Of
This commit is contained in:
commit
532a8621da
59 changed files with 148 additions and 166 deletions
|
@ -44,7 +44,7 @@ std::string GetExpressionForControl(const std::string& control_name,
|
|||
{
|
||||
// If our expression contains any non-alpha characters
|
||||
// we should quote it
|
||||
if (!std::all_of(expr.begin(), expr.end(), Common::IsAlpha))
|
||||
if (!std::ranges::all_of(expr, Common::IsAlpha))
|
||||
expr = fmt::format("`{}`", expr);
|
||||
}
|
||||
|
||||
|
@ -138,8 +138,8 @@ BuildExpression(const std::vector<ciface::Core::DeviceContainer::InputDetection>
|
|||
void RemoveSpuriousTriggerCombinations(
|
||||
std::vector<ciface::Core::DeviceContainer::InputDetection>* detections)
|
||||
{
|
||||
const auto is_spurious = [&](auto& detection) {
|
||||
return std::any_of(detections->begin(), detections->end(), [&](auto& d) {
|
||||
const auto is_spurious = [&](const auto& detection) {
|
||||
return std::ranges::any_of(*detections, [&](const auto& d) {
|
||||
// This is a spurious digital detection if a "smooth" (analog) detection is temporally near.
|
||||
return &d != &detection && d.smoothness > 1 && d.smoothness > detection.smoothness &&
|
||||
abs(d.press_time - detection.press_time) < SPURIOUS_TRIGGER_COMBO_THRESHOLD;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue