Skip to content

Commit 06f9d13

Browse files
committed
remove unnecessary include; unnecessary mutability; too specific requires; unused function
1 parent c6b7d8b commit 06f9d13

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

Framework/Core/include/Framework/AnalysisManagers.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,6 @@ void bindExternalIndicesPartition(P& partition, T*... tables)
534534
}
535535

536536
/// Cache handling
537-
template <typename T>
538-
bool preInitializeCache(InitContext&, T&)
539-
{
540-
return false;
541-
}
542-
543537
template <typename T>
544538
bool initializeCache(ProcessingContext&, T&)
545539
{

Framework/Core/include/Framework/AnalysisTask.h

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "Framework/EndOfStreamContext.h"
2323
#include "Framework/GroupSlicer.h"
2424
#include "Framework/StructToTuple.h"
25-
#include "Framework/Traits.h"
2625
#include "Framework/TypeIdHelpers.h"
2726
#include "Framework/ArrowTableSlicingCache.h"
2827
#include "Framework/AnalysisDataModel.h"
@@ -596,28 +595,21 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args)
596595
AnalysisDataProcessorBuilder::cacheFromArgs(&T::process, true, bindingsKeys, bindingsKeysUnsorted);
597596
}
598597
homogeneous_apply_refs(
599-
[&bindingsKeys, &bindingsKeysUnsorted](auto& x) mutable {
598+
[&bindingsKeys, &bindingsKeysUnsorted](auto& x) {
600599
return AnalysisDataProcessorBuilder::requestCacheFromArgs(x, bindingsKeys, bindingsKeysUnsorted);
601600
},
602601
*task.get());
603602

604603
ic.services().get<ArrowTableSlicingCacheDef>().setCaches(std::move(bindingsKeys));
605604
ic.services().get<ArrowTableSlicingCacheDef>().setCachesUnsorted(std::move(bindingsKeysUnsorted));
606-
// initialize global caches
607-
homogeneous_apply_refs([&ic](auto& element) {
608-
return analysis_task_parsers::preInitializeCache(ic, element);
609-
},
610-
*(task.get()));
611605

612606
return [task, expressionInfos](ProcessingContext& pc) mutable {
613607
// load the ccdb object from their cache
614608
homogeneous_apply_refs([&pc](auto& element) { return analysis_task_parsers::newDataframeCondition(pc.inputs(), element); }, *task.get());
615609
// reset partitions once per dataframe
616610
homogeneous_apply_refs([](auto& element) { return analysis_task_parsers::newDataframePartition(element); }, *task.get());
617611
// reset selections for the next dataframe
618-
for (auto& info : expressionInfos) {
619-
info.resetSelection = true;
620-
}
612+
std::ranges::for_each(expressionInfos, [](auto& info){ info.resetSelection = true; });
621613
// reset pre-slice for the next dataframe
622614
auto slices = pc.services().get<ArrowTableSlicingCache>();
623615
homogeneous_apply_refs([&pc, &slices](auto& element) {
@@ -633,17 +625,18 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args)
633625
task->run(pc);
634626
}
635627
// execute process()
636-
if constexpr (requires { AnalysisDataProcessorBuilder::invokeProcess(*(task.get()), pc.inputs(), &T::process, expressionInfos, slices); }) {
628+
if constexpr (requires { &T::process; }) {
637629
AnalysisDataProcessorBuilder::invokeProcess(*(task.get()), pc.inputs(), &T::process, expressionInfos, slices);
638630
}
639631
// execute optional process()
640632
homogeneous_apply_refs(
641-
[&pc, &expressionInfos, &task, &slices](auto& x) mutable {
642-
if constexpr (base_of_template<ProcessConfigurable, std::decay_t<decltype(x)>>) {
633+
[&pc, &expressionInfos, &task, &slices](auto& x) {
634+
if constexpr (is_process_configurable<decltype(x)>) {
643635
if (x.value == true) {
644636
AnalysisDataProcessorBuilder::invokeProcess(*task.get(), pc.inputs(), x.process, expressionInfos, slices);
645637
return true;
646638
}
639+
return false;
647640
}
648641
return false;
649642
},
@@ -657,9 +650,6 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args)
657650

658651
return {
659652
name,
660-
// FIXME: For the moment we hardcode this. We could build
661-
// this list from the list of methods actually implemented in the
662-
// task itself.
663653
inputs,
664654
outputs,
665655
algo,

0 commit comments

Comments
 (0)