Skip to content

Commit 7a8f48c

Browse files
committed
Fix - check bigint only if first entry had it
1 parent ce2a14e commit 7a8f48c

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

modules/rntuple.mjs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,14 +1137,27 @@ class TDrawSelectorTuple extends TDrawSelector {
11371137
/** @summary Returns true if field can be used as array */
11381138
isArrayBranch(/* tuple, br */) { return false; }
11391139

1140+
/** @summary Begin of processing */
1141+
Begin(tree) {
1142+
super.Begin(tree);
1143+
this._first_entry = true;
1144+
this._has_bigint = false;
1145+
}
1146+
11401147
/** @summary Process entry */
11411148
Process(entry) {
1142-
for (let n = 0; n < this.numBranches(); ++n) {
1143-
const name = this.nameOfBranch(n);
1144-
if (typeof this.tgtobj[name] === 'bigint')
1145-
this.tgtobj[name] = Number(this.tgtobj[name]);
1149+
if (this._first_entry || this._has_bigint) {
1150+
for (let n = 0; n < this.numBranches(); ++n) {
1151+
const name = this.nameOfBranch(n);
1152+
if (typeof this.tgtobj[name] === 'bigint') {
1153+
this.tgtobj[name] = Number(this.tgtobj[name]);
1154+
this._has_bigint = true;
1155+
}
1156+
}
11461157
}
11471158

1159+
this._first_entry = false;
1160+
11481161
super.Process(entry);
11491162
}
11501163

0 commit comments

Comments
 (0)