mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
SDK: Replace for loop with count_if
This commit is contained in:
parent
23423a86d9
commit
47d9e282d4
|
@ -9,6 +9,7 @@
|
||||||
#ifndef FAIR_MQ_SDK_TOPOLOGY_H
|
#ifndef FAIR_MQ_SDK_TOPOLOGY_H
|
||||||
#define FAIR_MQ_SDK_TOPOLOGY_H
|
#define FAIR_MQ_SDK_TOPOLOGY_H
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <asio/async_result.hpp>
|
#include <asio/async_result.hpp>
|
||||||
#include <asio/associated_executor.hpp>
|
#include <asio/associated_executor.hpp>
|
||||||
#include <asio/steady_timer.hpp>
|
#include <asio/steady_timer.hpp>
|
||||||
|
@ -450,12 +451,9 @@ class BasicTopology : public AsioBase<Executor, Allocator>
|
||||||
/// call only under locked fMtx!
|
/// call only under locked fMtx!
|
||||||
auto ResetTransitionedCount(DeviceState targetState) -> void
|
auto ResetTransitionedCount(DeviceState targetState) -> void
|
||||||
{
|
{
|
||||||
fTransitionedCount = 0;
|
fTransitionedCount = std::count_if(fState.cbegin(), fState.cend(), [=](const auto& s) {
|
||||||
for (const auto& s : fState) {
|
return s.second.state == targetState;
|
||||||
if (s.second.state == targetState) {
|
});
|
||||||
++fTransitionedCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// call only under locked fMtx!
|
/// call only under locked fMtx!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user