Skip to content

Commit f52b13d

Browse files
committed
std::any_of instead of a loop
1 parent 113d551 commit f52b13d

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Framework/Core/src/WorkflowHelpers.cxx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -269,20 +269,9 @@ void WorkflowHelpers::injectServiceDevices(WorkflowSpec& workflow, ConfigContext
269269
processor.options.push_back(ConfigParamSpec{"end-value-enumeration", VariantType::Int64, -1ll, {"final value for the enumeration"}});
270270
processor.options.push_back(ConfigParamSpec{"step-value-enumeration", VariantType::Int64, 1ll, {"step between one value and the other"}});
271271
}
272-
bool hasTimeframeInputs = false;
273-
for (auto& input : processor.inputs) {
274-
if (input.lifetime == Lifetime::Timeframe) {
275-
hasTimeframeInputs = true;
276-
break;
277-
}
278-
}
279-
bool hasTimeframeOutputs = false;
280-
for (auto& output : processor.outputs) {
281-
if (output.lifetime == Lifetime::Timeframe) {
282-
hasTimeframeOutputs = true;
283-
break;
284-
}
285-
}
272+
bool hasTimeframeInputs = std::any_of(processor.inputs.begin(), processor.inputs.end(), [](auto const& input){ return input.lifetime == Lifetime::Timeframe; });
273+
bool hasTimeframeOutputs = std::any_of(processor.outputs.begin(), processor.outputs.end(), [](auto const& output){ return output.lifetime == Lifetime::Timeframe; });
274+
286275
// A timeframeSink consumes timeframes without creating new
287276
// timeframe data.
288277
bool timeframeSink = hasTimeframeInputs && !hasTimeframeOutputs;

0 commit comments

Comments
 (0)