-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Remove needless array indirection in AbstractInternalTerms #126830
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
Remove needless array indirection in AbstractInternalTerms #126830
Conversation
Obviously just a single count, make it a plain field like the counter next to it.
Pinging @elastic/es-analytical-engine (Team:Analytics) |
} | ||
}); | ||
} else if (reduceContext.isFinalReduce()) { | ||
TopBucketBuilder<B> top = TopBucketBuilder.build( | ||
getRequiredSize(), | ||
getOrder(), | ||
removed -> otherDocCount[0] += removed.getDocCount(), | ||
removed -> otherDocCount += removed.getDocCount(), |
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.
I thought you cannot use mutable variables like that in lambda functions.
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.
You can if they are a field on an object, just not mutable locals :)
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.
👍
Thanks you two! |
💚 Backport successful
|
…26830) Obviously just a single count, make it a plain field like the counter next to it.
…26830) Obviously just a single count, make it a plain field like the counter next to it.
Randomly found small win :)
Obviously just a single count, make it a plain field like the counter next to it.