lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4674) Consistently set offset=0 in BytesRef.copyBytes
Date Thu, 10 Jan 2013 10:58:12 GMT


Robert Muir commented on LUCENE-4674:

moreover, any proposed changes here should also include the changes to IntsRef, LongsRef,
CharsRef, and so on before even being considered.

Otherwise the apis just get out of wack.

Maybe we should just seriously consider just switching to java.nio.Buffer.
> Consistently set offset=0 in BytesRef.copyBytes
> -----------------------------------------------
>                 Key: LUCENE-4674
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-4674.patch
> BytesRef.copyBytes(BytesRef other) has two branches:
>  - either the destination array is large enough and it will copy bytes after offset,
>  - or it needs to resize and in that case it will set offset = 0.
> I think this method should always set offset = 0 for consistency, and to avoid resizing
when other.length is larger than this.bytes.length - this.offset but smaller than this.bytes.length.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message