accumulator: for loop -> std::any_of
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-14 07:25:10 +01:00
parent 61dbc4b666
commit 2f452de8be
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -5,6 +5,7 @@
#include <fmt/core.h>
#include <algorithm>
#include <chrono>
#include <cstdint>
#include <thread>
@ -28,12 +29,11 @@ auto Accumulator::src_is_registered(const uint8_t& id) -> bool {
bool reg{false};
static uint8_t _src_id{};
for (auto& src_id: this->entropy_sources) {
if (src_id == id) {
reg = true;
_src_id = id;
break;
}
if (std::any_of(this->entropy_sources.begin(),
this->entropy_sources.end(),
[&](auto& src_id) { return src_id == id; })) {
reg = true;
_src_id = id;
}
if (reg) {