-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use growNoCopy in some places #12951
Conversation
@@ -60,6 +60,13 @@ public void grow(int capacity) { | |||
ref.bytes = ArrayUtil.grow(ref.bytes, capacity); | |||
} | |||
|
|||
/** | |||
* Used to grow the builder without coping bytes. see {@link ArrayUtil#growNoCopy(byte[], int)}. |
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.
* Used to grow the builder without coping bytes. see {@link ArrayUtil#growNoCopy(byte[], int)}. | |
* Used to grow the builder without copying bytes. see {@link ArrayUtil#growNoCopy(byte[], int)}. |
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.
Thank you @dweiss , sorry for the typo!
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution! |
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 think toUTF16
is another method in this class that can use growNoCopy
. But it would require implementing it for IntsRefBuilder
. Which can lead to using it in a few other places where we call IntsRefBuilder#grow
now?
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.
Nice find! Thank you @epotyom !
# Conflicts: # lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDocValuesReader.java
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.
Nice improvement, approved!
Thank you for reviewing! |
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution! |
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.
LGTM. Will merge shortly. Thank you.
I've backported to branch_9x as well. |
Found some
grow
method can be change togrowNoCopy
when reading code.