Skip to content

Commit

Permalink
Modernize std::any_of with ranges
Browse files Browse the repository at this point in the history
In WiimoteReal.cpp, JitRegCache.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able 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.
  • Loading branch information
mitaclaw committed Dec 16, 2024
1 parent 860e6cf commit 140252f
Show file tree
Hide file tree
Showing 34 changed files with 69 additions and 82 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Common/Debug/MemoryPatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void MemoryPatches::DisablePatch(const Core::CPUThreadGuard& guard, std::size_t

bool MemoryPatches::HasEnabledPatch(u32 address) const
{
return std::any_of(m_patches.begin(), m_patches.end(), [address](const MemoryPatch& patch) {
return std::ranges::any_of(m_patches, [address](const MemoryPatch& patch) {
return patch.address == address && patch.is_enabled == MemoryPatch::State::Enabled;
});
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Common/Debug/Watches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void Watches::DisableWatch(std::size_t index)

bool Watches::HasEnabledWatch(u32 address) const
{
return std::any_of(m_watches.begin(), m_watches.end(), [address](const auto& watch) {
return std::ranges::any_of(m_watches, [address](const auto& watch) {
return watch.address == address && watch.is_enabled == Watch::State::Enabled;
});
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Common/FileSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& directorie
// N.B. This avoids doing any copies
auto ext_matches = [&native_exts](const fs::path& path) {
const std::basic_string_view<fs::path::value_type> native_path = path.native();
return std::any_of(native_exts.cbegin(), native_exts.cend(), [&native_path](const auto& ext) {
return std::ranges::any_of(native_exts, [&native_path](const auto& ext) {
const auto compare_len = ext.native().length();
if (native_path.length() < compare_len)
return false;
Expand Down
5 changes: 2 additions & 3 deletions Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,8 @@ class BaseConfigLayerLoader final : public Config::ConfigLayerLoader
for (const auto& value : section_map)
{
const Config::Location location{system.first, section_name, value.first};
const bool load_disallowed =
std::any_of(begin(s_setting_disallowed), end(s_setting_disallowed),
[&location](const Config::Location* l) { return *l == location; });
const bool load_disallowed = std::ranges::any_of(
s_setting_disallowed, [&location](const auto* l) { return *l == location; });
if (load_disallowed)
continue;

Expand Down
7 changes: 3 additions & 4 deletions Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ bool IsSettingSaveable(const Config::Location& config_location)
&Config::WIIMOTE_BB_SOURCE.GetLocation(),
};

return std::any_of(begin(s_setting_saveable), end(s_setting_saveable),
[&config_location](const Config::Location* location) {
return *location == config_location;
});
return std::ranges::any_of(s_setting_saveable, [&config_location](const auto* location) {
return *location == config_location;
});
}
} // namespace ConfigLoaders
4 changes: 2 additions & 2 deletions Source/Core/Core/Debugger/CodeTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ HitType CodeTrace::TraceLogic(const TraceOutput& current_instr, bool first_hit)

// Checks if the intstruction is a type that needs special handling.
const auto CompareInstruction = [](std::string_view instruction, const auto& type_compare) {
return std::any_of(type_compare.begin(), type_compare.end(),
[&instruction](std::string_view s) { return instruction.starts_with(s); });
return std::ranges::any_of(
type_compare, [&instruction](std::string_view s) { return instruction.starts_with(s); });
};

// Exclusions from updating tracking logic. mt operations are too complex and specialized.
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/Core/HW/GCMemcard/GCMemcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ std::pair<GCMemcardErrorCode, std::optional<GCMemcard>> GCMemcard::Open(std::str
MBIT_SIZE_MEMORY_CARD_2043,
}};

if (!std::any_of(valid_megabits.begin(), valid_megabits.end(),
[filesize_megabits](u64 mbits) { return mbits == filesize_megabits; }))
if (!std::ranges::any_of(valid_megabits,
[filesize_megabits](u64 mbits) { return mbits == filesize_megabits; }))
{
error_code.Set(GCMemcardValidityIssues::INVALID_CARD_SIZE);
return std::make_pair(error_code, std::nullopt);
Expand Down Expand Up @@ -1296,8 +1296,8 @@ GCMemcardErrorCode Header::CheckForErrors(u16 card_size_mbits) const
error_code.Set(GCMemcardValidityIssues::MISMATCHED_CARD_SIZE);

// unused areas, should always be filled with 0xFF
if (std::any_of(m_unused_1.begin(), m_unused_1.end(), [](u8 val) { return val != 0xFF; }) ||
std::any_of(m_unused_2.begin(), m_unused_2.end(), [](u8 val) { return val != 0xFF; }))
if (std::ranges::any_of(m_unused_1, [](u8 val) { return val != 0xFF; }) ||
std::ranges::any_of(m_unused_2, [](u8 val) { return val != 0xFF; }))
{
error_code.Set(GCMemcardValidityIssues::DATA_IN_UNUSED_AREA);
}
Expand Down Expand Up @@ -1361,7 +1361,7 @@ GCMemcardErrorCode Directory::CheckForErrors() const
error_code.Set(GCMemcardValidityIssues::INVALID_CHECKSUM);

// unused area, should always be filled with 0xFF
if (std::any_of(m_padding.begin(), m_padding.end(), [](u8 val) { return val != 0xFF; }))
if (std::ranges::any_of(m_padding, [](u8 val) { return val != 0xFF; }))
error_code.Set(GCMemcardValidityIssues::DATA_IN_UNUSED_AREA);

return error_code;
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,7 @@ void WiimoteScanner::SetScanMode(WiimoteScanMode scan_mode)
bool WiimoteScanner::IsReady() const
{
std::lock_guard lg(m_backends_mutex);
return std::any_of(m_backends.begin(), m_backends.end(),
[](const auto& backend) { return backend->IsReady(); });
return std::ranges::any_of(m_backends, &WiimoteScannerBackend::IsReady);
}

static void CheckForDisconnectedWiimotes()
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/IOS/ES/TitleManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ ReturnCode ESCore::DeleteSharedContent(const std::array<u8, 20>& sha1) const

// Check whether the shared content is used by a system title.
const std::vector<u64> titles = GetInstalledTitles();
const bool is_used_by_system_title = std::any_of(titles.begin(), titles.end(), [&](u64 id) {
const bool is_used_by_system_title = std::ranges::any_of(titles, [&](u64 id) {
if (!ES::IsTitleType(id, ES::TitleType::System))
return false;

Expand All @@ -887,8 +887,8 @@ ReturnCode ESCore::DeleteSharedContent(const std::array<u8, 20>& sha1) const
return true;

const auto contents = tmd.GetContents();
return std::any_of(contents.begin(), contents.end(),
[&sha1](const auto& content) { return content.sha1 == sha1; });
return std::ranges::any_of(contents,
[&sha1](const auto& content) { return content.sha1 == sha1; });
});

// Any shared content used by a system title cannot be deleted.
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/IOS/FS/FileSystemCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bool IsValidNonRootPath(std::string_view path)
bool IsValidFilename(std::string_view filename)
{
return filename.length() <= MaxFilenameLength &&
!std::any_of(filename.begin(), filename.end(), [](char c) { return c == '/'; });
!std::ranges::any_of(filename, [](char c) { return c == '/'; });
}

SplitPathResult SplitPathAndBasename(std::string_view path)
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/IOS/FS/HostBackend/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,14 @@ ResultCode HostFileSystem::CreateDirectory(Uid uid, Gid gid, const std::string&

bool HostFileSystem::IsFileOpened(const std::string& path) const
{
return std::any_of(m_handles.begin(), m_handles.end(), [&path](const Handle& handle) {
return std::ranges::any_of(m_handles, [&path](const Handle& handle) {
return handle.opened && handle.wii_path == path;
});
}

bool HostFileSystem::IsDirectoryInUse(const std::string& path) const
{
return std::any_of(m_handles.begin(), m_handles.end(), [&path](const Handle& handle) {
return std::ranges::any_of(m_handles, [&path](const Handle& handle) {
return handle.opened && handle.wii_path.starts_with(path);
});
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/IOS/Network/KD/Mail/WC24FriendList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ bool WC24FriendList::CheckFriendList() const

bool WC24FriendList::DoesFriendExist(u64 friend_id) const
{
return std::any_of(m_data.friend_codes.cbegin(), m_data.friend_codes.cend(),
[&friend_id](const u64 v) { return v == friend_id; });
return std::ranges::any_of(m_data.friend_codes,
[&friend_id](const u64 v) { return v == friend_id; });
}

std::vector<u64> WC24FriendList::GetUnconfirmedFriends() const
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/IOS/USB/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool Device::HasClass(const u8 device_class) const
if (GetDeviceDescriptor().bDeviceClass == device_class)
return true;
const auto interfaces = GetInterfaces(0);
return std::any_of(interfaces.begin(), interfaces.end(), [device_class](const auto& interface) {
return std::ranges::any_of(interfaces, [device_class](const auto& interface) {
return interface.bInterfaceClass == device_class;
});
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/IOS/USB/OH0/OH0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ std::optional<IPCReply> OH0::RegisterClassChangeHook(const IOCtlVRequest& reques

bool OH0::HasDeviceWithVidPid(const u16 vid, const u16 pid) const
{
return std::any_of(m_devices.begin(), m_devices.end(), [=](const auto& device) {
return std::ranges::any_of(m_devices, [=](const auto& device) {
return device.second->GetVid() == vid && device.second->GetPid() == pid;
});
}
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/IOS/VersionInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ bool IsEmulated(u32 major_version)
if (major_version == static_cast<u32>(Titles::BC & 0xffffffff))
return true;

return std::any_of(
ios_memory_values.begin(), ios_memory_values.end(),
[major_version](const MemoryValues& values) { return values.ios_number == major_version; });
return std::ranges::any_of(ios_memory_values, [major_version](const MemoryValues& values) {
return values.ios_number == major_version;
});
}

bool IsEmulated(u64 title_id)
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/IOS/WFS/WFSSRV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ s32 WFSSRVDevice::Rename(std::string source, std::string dest) const

INFO_LOG_FMT(IOS_WFS, "IOCTL_WFS_RENAME: {} to {}", source, dest);

const bool opened = std::any_of(m_fds.begin(), m_fds.end(),
[&](const auto& fd) { return fd.in_use && fd.path == source; });
const bool opened =
std::ranges::any_of(m_fds, [&](const auto& fd) { return fd.in_use && fd.path == source; });

if (opened)
return WFS_FILE_IS_OPENED;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/NetPlayClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2486,8 +2486,8 @@ bool NetPlayClient::PlayerHasControllerMapped(const PlayerId pid) const
{
const auto mapping_matches_player_id = [pid](const PlayerId& mapping) { return mapping == pid; };

return std::any_of(m_pad_map.begin(), m_pad_map.end(), mapping_matches_player_id) ||
std::any_of(m_wiimote_map.begin(), m_wiimote_map.end(), mapping_matches_player_id);
return std::ranges::any_of(m_pad_map, mapping_matches_player_id) ||
std::ranges::any_of(m_wiimote_map, mapping_matches_player_id);
}

bool NetPlayClient::IsLocalPlayer(const PlayerId pid) const
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/NetPlayServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2232,8 +2232,8 @@ bool NetPlayServer::PlayerHasControllerMapped(const PlayerId pid) const
{
const auto mapping_matches_player_id = [pid](const PlayerId& mapping) { return mapping == pid; };

return std::any_of(m_pad_map.begin(), m_pad_map.end(), mapping_matches_player_id) ||
std::any_of(m_wiimote_map.begin(), m_wiimote_map.end(), mapping_matches_player_id);
return std::ranges::any_of(m_pad_map, mapping_matches_player_id) ||
std::ranges::any_of(m_wiimote_map, mapping_matches_player_id);
}

void NetPlayServer::AssignNewUserAPad(const Client& player)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/BreakPoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ bool MemChecks::OverlapsMemcheck(u32 address, u32 length) const
const u32 page_end_suffix = length - 1;
const u32 page_end_address = address | page_end_suffix;

return std::any_of(m_mem_checks.cbegin(), m_mem_checks.cend(), [&](const auto& mc) {
return std::ranges::any_of(m_mem_checks, [&](const auto& mc) {
return ((mc.start_address | page_end_suffix) == page_end_address ||
(mc.end_address | page_end_suffix) == page_end_address) ||
((mc.start_address | page_end_suffix) < page_end_address &&
Expand Down
7 changes: 3 additions & 4 deletions Source/Core/Core/PowerPC/Expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,14 @@ static double CallstackFunc(expr_func* f, vec_expr_t* args, void* c)
if (!std::isnan(num))
{
u32 address = static_cast<u32>(num);
return std::any_of(stack.begin(), stack.end(),
[address](const auto& s) { return s.vAddress == address; });
return std::ranges::any_of(stack, [address](const auto& s) { return s.vAddress == address; });
}

const char* cstr = expr_get_str(&vec_nth(args, 0));
if (cstr != nullptr)
{
return std::any_of(stack.begin(), stack.end(),
[cstr](const auto& s) { return s.Name.find(cstr) != std::string::npos; });
return std::ranges::any_of(
stack, [cstr](const auto& s) { return s.Name.find(cstr) != std::string::npos; });
}

return 0;
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,5 @@ void RegCache::Realize(preg_t preg)

bool RegCache::IsAnyConstraintActive() const
{
return std::any_of(m_constraints.begin(), m_constraints.end(),
[](const auto& c) { return c.IsActive(); });
return std::ranges::any_of(m_constraints, &RCConstraint::IsActive);
}
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/JitCommon/JitBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ JitBase::~JitBase()

bool JitBase::DoesConfigNeedRefresh()
{
return std::any_of(JIT_SETTINGS.begin(), JIT_SETTINGS.end(), [this](const auto& pair) {
return std::ranges::any_of(JIT_SETTINGS, [this](const auto& pair) {
return this->*pair.first != Config::Get(*pair.second);
});
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/PPCAnalyst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static void AnalyzeFunction2(PPCSymbolDB* func_db, Common::Symbol* func)
{
u32 flags = func->flags;

bool nonleafcall = std::any_of(func->calls.begin(), func->calls.end(), [&](const auto& call) {
bool nonleafcall = std::ranges::any_of(func->calls, [&](const auto& call) {
const Common::Symbol* const called_func = func_db->GetSymbolFromAddr(call.function);
return called_func && (called_func->flags & Common::FFLAG_LEAF) == 0;
});
Expand Down
11 changes: 5 additions & 6 deletions Source/Core/Core/WiiUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,14 @@ bool IsTitleInstalled(u64 title_id)
// Since this isn't IOS and we only need a simple way to figure out if a title is installed,
// we make the (reasonable) assumption that having more than just the TMD in the content
// directory means that the title is installed.
return std::any_of(entries->begin(), entries->end(),
[](const std::string& file) { return file != "title.tmd"; });
return std::ranges::any_of(*entries, [](const std::string& file) { return file != "title.tmd"; });
}

bool IsTMDImported(IOS::HLE::FS::FileSystem& fs, u64 title_id)
{
const auto entries = fs.ReadDirectory(0, 0, Common::GetTitleContentPath(title_id));
return entries && std::any_of(entries->begin(), entries->end(),
[](const std::string& file) { return file == "title.tmd"; });
return entries &&
std::ranges::any_of(*entries, [](const std::string& file) { return file == "title.tmd"; });
}

IOS::ES::TMDReader FindBackupTMD(IOS::HLE::FS::FileSystem& fs, u64 title_id)
Expand Down Expand Up @@ -947,8 +946,8 @@ static NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios, bool repair)
}

const auto installed_contents = es.GetStoredContentsFromTMD(tmd);
const bool is_installed = std::any_of(installed_contents.begin(), installed_contents.end(),
[](const auto& content) { return !content.IsShared(); });
const bool is_installed = std::ranges::any_of(
installed_contents, [](const auto& content) { return !content.IsShared(); });

if (is_installed && installed_contents != tmd.GetContents() &&
(tmd.GetTitleFlags() & IOS::ES::TitleFlags::TITLE_TYPE_DATA) == 0)
Expand Down
9 changes: 4 additions & 5 deletions Source/Core/DiscIO/VolumeVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,16 +729,15 @@ bool VolumeVerifier::ShouldHaveInstallPartition() const
static constexpr std::array<std::string_view, 4> dragon_quest_x = {"S4MJGD", "S4SJGD", "S6TJGD",
"SDQJGD"};
const std::string& game_id = m_volume.GetGameID();
return std::any_of(dragon_quest_x.cbegin(), dragon_quest_x.cend(),
[&game_id](std::string_view x) { return x == game_id; });
return std::ranges::any_of(dragon_quest_x,
[&game_id](std::string_view x) { return x == game_id; });
}

bool VolumeVerifier::ShouldHaveMasterpiecePartitions() const
{
static constexpr std::array<std::string_view, 4> ssbb = {"RSBE01", "RSBJ01", "RSBK01", "RSBP01"};
const std::string& game_id = m_volume.GetGameID();
return std::any_of(ssbb.cbegin(), ssbb.cend(),
[&game_id](std::string_view x) { return x == game_id; });
return std::ranges::any_of(ssbb, [&game_id](std::string_view x) { return x == game_id; });
}

bool VolumeVerifier::ShouldBeDualLayer() const
Expand Down Expand Up @@ -1039,7 +1038,7 @@ void VolumeVerifier::CheckSuperPaperMario()
if (!m_volume.Read(offset, length, data.data(), partition))
return;

if (std::any_of(data.cbegin(), data.cend(), [](u8 x) { return x != 0; }))
if (std::ranges::any_of(data, [](u8 x) { return x != 0; }))
{
AddProblem(Severity::High,
Common::GetStringT("Some padding data that should be zero is not zero. "
Expand Down
5 changes: 2 additions & 3 deletions Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,8 @@ void ShakeMappingIndicator::Update(float elapsed_seconds)

m_position_samples.push_front(ShakeSample{m_motion_state.position / MAX_DISTANCE});

const bool any_non_zero_samples =
std::any_of(m_position_samples.begin(), m_position_samples.end(),
[](const ShakeSample& s) { return s.state.LengthSquared() != 0.0; });
const bool any_non_zero_samples = std::ranges::any_of(
m_position_samples, [](const ShakeSample& s) { return s.state.LengthSquared() != 0.0; });

// Only start moving the line if there's non-zero data.
if (m_grid_line_position || any_non_zero_samples)
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/DolphinQt/ConvertDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void ConvertDialog::Convert()
}

if (!scrub && format == DiscIO::BlobType::GCZ &&
std::any_of(m_files.begin(), m_files.end(), [](const auto& file) {
std::ranges::any_of(m_files, [](const auto& file) {
return file->GetPlatform() == DiscIO::Platform::WiiDisc && !file->IsDatelDisc();
}))
{
Expand All @@ -321,7 +321,7 @@ void ConvertDialog::Convert()
}
}

if (std::any_of(m_files.begin(), m_files.end(), std::mem_fn(&UICommon::GameFile::IsNKit)))
if (std::ranges::any_of(m_files, &UICommon::GameFile::IsNKit))
{
if (!ShowAreYouSureDialog(
tr("Dolphin can't convert NKit files to non-NKit files. Converting an NKit file in "
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/DolphinQt/Settings/AudioPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,7 @@ void AudioPane::OnVolumeChanged(int volume)
void AudioPane::CheckNeedForLatencyControl()
{
std::vector<std::string> backends = AudioCommon::GetSoundBackends();
m_latency_control_supported =
std::any_of(backends.cbegin(), backends.cend(), AudioCommon::SupportsLatencyControl);
m_latency_control_supported = std::ranges::any_of(backends, AudioCommon::SupportsLatencyControl);
}

QString AudioPane::GetDPL2QualityLabel(AudioCommon::DPL2Quality value) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ void IMUGyroscope::UpdateCalibration(const StateData& state)
// Check for required calibration update frequency
// and if current data is within deadzone distance of mean stable value.
if (calibration_freq < WORST_ACCEPTABLE_CALIBRATION_UPDATE_FREQUENCY ||
std::any_of(current_difference.data.begin(), current_difference.data.end(),
[&](auto c) { return std::abs(c) > deadzone; }))
std::ranges::any_of(current_difference.data,
[&](auto c) { return std::abs(c) > deadzone; }))
{
RestartCalibration();
}
Expand Down
Loading

0 comments on commit 140252f

Please sign in to comment.