accumulator: for loop -> std::any_of
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
61dbc4b666
commit
2f452de8be
|
@ -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) {
|
||||
|
|
Reference in New Issue