Skip to content

Commit f956573

Browse files
committed
[RDF] Keep RJittedDefine pointers invariant when columns don't change.
In order to not write a column multiple times in a snapshot with variations, the RDefineBase pointer needs to stay invariant when a variation is generated. However, the RJittedDefine was returning the pointer to its member, so it looked like the column was affected by variations. Here, this is changed to returning "this" when no variations are in effect.
1 parent b64d044 commit f956573

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tree/dataframe/src/RJittedDefine.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,10 @@ void RJittedDefine::MakeVariations(const std::vector<std::string> &variations)
6666
RDefineBase &RJittedDefine::GetVariedDefine(const std::string &variationName)
6767
{
6868
assert(fConcreteDefine != nullptr);
69-
return fConcreteDefine->GetVariedDefine(variationName);
69+
70+
auto &variedDefine = fConcreteDefine->GetVariedDefine(variationName);
71+
if (&variedDefine == fConcreteDefine.get())
72+
return *this; // Ensures that the pointer is the same across all variations
73+
else
74+
return variedDefine;
7075
}

0 commit comments

Comments
 (0)