You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "George Aroush (JIRA)" <ji...@apache.org> on 2007/03/10 17:20:10 UTC

[jira] Resolved: (LUCENENET-30) Unnecessary boxing of bytes

     [ https://issues.apache.org/jira/browse/LUCENENET-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

George Aroush resolved LUCENENET-30.
------------------------------------

    Resolution: Fixed

Fixed for Apache Lucene.Net 2.0 build 004

> Unnecessary boxing of bytes
> ---------------------------
>
>                 Key: LUCENENET-30
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-30
>             Project: Lucene.Net
>          Issue Type: Improvement
>         Environment: Linux, Lucene.Net 2.0
>            Reporter: Joe Shaw
>         Assigned To: George Aroush
>
> SegmentReader.CreateFakeNorms() unnecessarily boxes bytes:
> byte[] ones = new byte[size];
> byte val = DefaultSimilarity.EncodeNorm(1.0f);
> for (int index = 0; index < size; index++)
>     ones.SetValue(val, index);
> Because Array.SetValue() takes an object for the first argument, each byte is boxed.
> Changing the SetValue() call to:
>     ones [index] = val;
> fixes the problem, because array indexers are type checked.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.