-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - fix upsert_leaf not setting a MeasureFunc for new leaf nodes #7351
[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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_leaf
method creates a newMeasureFunc
and, if required, a new leaf node, but then it only adds the newMeasureFunc
to existing leaf nodes.Solution
Add the
MeasureFunc
to new leaf nodes as well.