You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "bruno-roustant (via GitHub)" <gi...@apache.org> on 2024/05/11 16:44:53 UTC
[PR] Call ArrayUtil.copyOf instead of ArrayUtil.copySubArray for full array copy. [lucene]
bruno-roustant opened a new pull request, #13360:
URL: https://github.com/apache/lucene/pull/13360
ArrayUtil provides copySubArray() as replacement of Array.copyOf and Array.copyOfRange (with better bounds check). Unfortunately ArrayUtil does not provide copyArray(), so it is weird for callers to have to call a method named copySubArray() when we want to copy the full array.
This PR adds ArrayUtil.copyArray(), and replaces the calls to ArrayUtil.copySubArray(array, 0, array.length) with calls to ArrayUtil.copyArray(array).
I used the following regex to match all calls:
`copyOfSubArray\(([^,]+), 0, .+\.length\)
`and this one to replace
`copyOf($1)`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Call ArrayUtil.copyArray instead of ArrayUtil.copySubArray for full array copy. [lucene]
Posted by "bruno-roustant (via GitHub)" <gi...@apache.org>.
bruno-roustant merged PR #13360:
URL: https://github.com/apache/lucene/pull/13360
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org