@@ -83,31 +83,28 @@ class R__CLING_PTRCHECK(off) RDefine final : public RDefineBase {
8383 }
8484
8585 template <typename ... ColTypes, std::size_t ... S>
86- void UpdateHelper (unsigned int slot, std::size_t idx, Long64_t /* entry*/ , TypeList<ColTypes...>,
86+ auto UpdateHelper (unsigned int slot, std::size_t idx, Long64_t /* entry*/ , TypeList<ColTypes...>,
8787 std::index_sequence<S...>, NoneTag)
8888 {
89- fLastResults [slot * RDFInternal::CacheLineStep<ret_type>()] =
90- fExpression (GetValueChecked<ColTypes>(slot, S, idx)...);
89+ return fExpression (GetValueChecked<ColTypes>(slot, S, idx)...);
9190 (void )idx; // avoid unused parameter warning (gcc 12.1)
9291 }
9392
9493 template <typename ... ColTypes, std::size_t ... S>
95- void UpdateHelper (unsigned int slot, std::size_t idx, Long64_t /* entry*/ , TypeList<ColTypes...>,
94+ auto UpdateHelper (unsigned int slot, std::size_t idx, Long64_t /* entry*/ , TypeList<ColTypes...>,
9695 std::index_sequence<S...>, SlotTag)
9796 {
98- fLastResults [slot * RDFInternal::CacheLineStep<ret_type>()] =
99- fExpression (slot, GetValueChecked<ColTypes>(slot, S, idx)...);
97+ return fExpression (slot, GetValueChecked<ColTypes>(slot, S, idx)...);
10098 (void )idx; // avoid unused parameter warning (gcc 12.1)
10199 }
102100
103101 template <typename ... ColTypes, std::size_t ... S>
104- void UpdateHelper (unsigned int slot, std::size_t idx, Long64_t batchFirstEntry , TypeList<ColTypes...>,
102+ auto UpdateHelper (unsigned int slot, std::size_t idx, Long64_t entryInBatch , TypeList<ColTypes...>,
105103 std::index_sequence<S...>, SlotAndEntryTag)
106104 {
107- fLastResults [slot * RDFInternal::CacheLineStep<ret_type>()] =
108- fExpression (slot, batchFirstEntry + idx, GetValueChecked<ColTypes>(slot, S, idx)...);
105+ return fExpression (slot, entryInBatch, GetValueChecked<ColTypes>(slot, S, idx)...);
109106 (void )idx; // avoid unused parameter warning (gcc 12.1)
110- (void )batchFirstEntry; // avoid unused parameter warning (gcc 12.1)
107+ (void )entryInBatch; // avoid unused parameter warning (gcc 12.1)
111108 }
112109
113110public:
@@ -138,13 +135,20 @@ public:
138135 }
139136
140137 // / Update the value at the address returned by GetValuePtr with the content corresponding to the given entry
141- void Update (unsigned int slot, Long64_t entry, bool mask) final
138+ void Update (unsigned int slot, const ROOT ::Internal:: RDF ::RMaskedEntryRange & mask) final
142139 {
143- if (entry != fLastCheckedEntry [slot * RDFInternal::CacheLineStep<Long64_t>()]) {
144- std::for_each (fValues [slot].begin (), fValues [slot].end (), [entry, mask](auto *v) { v->Load (entry, mask); });
145- if (mask) {
146- UpdateHelper (slot, /* idx=*/ 0u , entry, ColumnTypes_t{}, TypeInd_t{}, ExtraArgsTag{});
147- fLastCheckedEntry [slot * RDFInternal::CacheLineStep<Long64_t>()] = entry;
140+ if (static_cast <Long64_t>(mask.GetFirstEntry ()) ==
141+ fLastCheckedEntry [slot * RDFInternal::CacheLineStep<Long64_t>()])
142+ return ;
143+
144+ std::for_each (fValues [slot].begin (), fValues [slot].end (), [&mask](auto *v) { v->Load (mask); });
145+ // Assume 1-size bulk for now
146+ const std::size_t bulkSize = 1 ;
147+ auto &result = fLastResults [slot * RDFInternal::CacheLineStep<ret_type>()];
148+ for (std::size_t i = 0 ; i < bulkSize; ++i) {
149+ if (mask[i]) {
150+ result = UpdateHelper (slot, i, mask.GetFirstEntry () + i, ColumnTypes_t{}, TypeInd_t{}, ExtraArgsTag{});
151+ fLastCheckedEntry [slot * RDFInternal::CacheLineStep<Long64_t>()] = mask.GetFirstEntry ();
148152 }
149153 }
150154 }
0 commit comments