[Merged by Bors] - fix upsert_leaf not setting a MeasureFunc for new leaf nodes#7351
Conversation
The upsert_leaf method creates a new MeasureFunc and if required a new leaf node,
but the new MeasureFunc was only added to existing leaf nodes, not newly created nodes.
This adds the new MeasureFunc to new leaf nodes as well.
I'm not quite sure how much impact this had or whether this fixes any other bugs.
It might have caused slight glitches or some UI updates to be delayed for a frame.
|
Oops, this seems like a regression from #6743. I think this could be a one line diff with |
alice-i-cecile
left a comment
There was a problem hiding this comment.
This LGTM, but I agree that we should be able to do this more concisely.
ah, I should have checked the history.
I think this version is probably better, even though it's more verbose. |
|
Hm. At a glance, |
I'm not seeing this on my end. CI runs without error locally with the minimal fix. |
|
bors r+ |
# Problem The `upsert_leaf` method creates a new `MeasureFunc` and, if required, a new leaf node, but then it only adds the new `MeasureFunc` to existing leaf nodes. ## Solution Add the `MeasureFunc` to new leaf nodes as well.
I meant that in the concise version, the linter didn't detect that the MeasureFunc variable was unused because it was still consumed on the other code path. The longer version is more robust in that we'd get an unused variable warning in that case. I agree that it isn't clear whether there is some hidden performance cost though. Anyway, it doesn't seem worth obsessing about so I put things back as they were. |
|
Makes sense, thanks for clarifying. Agreed. |
…ine#7351) # Problem The `upsert_leaf` method creates a new `MeasureFunc` and, if required, a new leaf node, but then it only adds the new `MeasureFunc` to existing leaf nodes. ## Solution Add the `MeasureFunc` to new leaf nodes as well.
Problem
The
upsert_leafmethod creates a newMeasureFuncand, if required, a new leaf node, but then it only adds the newMeasureFuncto existing leaf nodes.Solution
Add the
MeasureFuncto new leaf nodes as well.