@@ -83,31 +83,31 @@ 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)...);
91- (void )idx; // avoid unused parameter warning (gcc 12.1)
89+ return fExpression (GetValueChecked<ColTypes>(slot, S, idx)...);
90+ ( void )slot; // avoid unused parameter warning
91+ (void )idx; // avoid unused parameter warning
9292 }
9393
9494 template <typename ... ColTypes, std::size_t ... S>
95- void UpdateHelper (unsigned int slot, std::size_t idx, Long64_t /* entry*/ , TypeList<ColTypes...>,
95+ auto UpdateHelper (unsigned int slot, std::size_t idx, Long64_t /* entry*/ , TypeList<ColTypes...>,
9696 std::index_sequence<S...>, SlotTag)
9797 {
98- fLastResults [ slot * RDFInternal::CacheLineStep<ret_type>()] =
99- fExpression ( slot, GetValueChecked<ColTypes>(slot, S, idx)...);
100- (void )idx; // avoid unused parameter warning (gcc 12.1)
98+ return fExpression ( slot, GetValueChecked<ColTypes>(slot, S, idx)...);
99+ ( void ) slot; // avoid unused parameter warning
100+ (void )idx; // avoid unused parameter warning
101101 }
102102
103103 template <typename ... ColTypes, std::size_t ... S>
104- void UpdateHelper (unsigned int slot, std::size_t idx, Long64_t batchFirstEntry , TypeList<ColTypes...>,
104+ auto UpdateHelper (unsigned int slot, std::size_t idx, Long64_t entryInBatch , TypeList<ColTypes...>,
105105 std::index_sequence<S...>, SlotAndEntryTag)
106106 {
107- fLastResults [ slot * RDFInternal::CacheLineStep<ret_type>()] =
108- fExpression (slot, batchFirstEntry + idx, GetValueChecked<ColTypes>(slot, S, idx)...);
109- (void )idx; // avoid unused parameter warning (gcc 12.1)
110- (void )batchFirstEntry ; // avoid unused parameter warning (gcc 12.1)
107+ return fExpression ( slot, entryInBatch, GetValueChecked<ColTypes>(slot, S, idx)...);
108+ ( void )slot; // avoid unused parameter warning
109+ (void )idx; // avoid unused parameter warning
110+ (void )entryInBatch ; // avoid unused parameter warning
111111 }
112112
113113public:
@@ -138,13 +138,20 @@ public:
138138 }
139139
140140 // / 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
141+ void Update (unsigned int slot, const ROOT ::Internal:: RDF ::RMaskedEntryRange & mask) final
142142 {
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;
143+ if (static_cast <Long64_t>(mask.GetFirstEntry ()) ==
144+ fLastCheckedEntry [slot * RDFInternal::CacheLineStep<Long64_t>()])
145+ return ;
146+
147+ std::for_each (fValues [slot].begin (), fValues [slot].end (), [&mask](auto *v) { v->Load (mask); });
148+ // Assume 1-size bulk for now
149+ const std::size_t bulkSize = 1 ;
150+ auto &result = fLastResults [slot * RDFInternal::CacheLineStep<ret_type>()];
151+ for (std::size_t i = 0 ; i < bulkSize; ++i) {
152+ if (mask[i]) {
153+ result = UpdateHelper (slot, i, mask.GetFirstEntry () + i, ColumnTypes_t{}, TypeInd_t{}, ExtraArgsTag{});
154+ fLastCheckedEntry [slot * RDFInternal::CacheLineStep<Long64_t>()] = mask.GetFirstEntry ();
148155 }
149156 }
150157 }
0 commit comments