You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Joe Shaw (JIRA)" <ji...@apache.org> on 2006/11/29 20:36:21 UTC
[jira] Created: (LUCENENET-30) Unnecessary boxing of bytes
Unnecessary boxing of bytes
---------------------------
Key: LUCENENET-30
URL: http://issues.apache.org/jira/browse/LUCENENET-30
Project: Lucene.Net
Issue Type: Improvement
Environment: Linux, Lucene.Net 2.0
Reporter: Joe Shaw
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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (LUCENENET-30) Unnecessary boxing of bytes
Posted by "George Aroush (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
George Aroush closed LUCENENET-30.
----------------------------------
> 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.
[jira] Resolved: (LUCENENET-30) Unnecessary boxing of bytes
Posted by "Joe Shaw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joe Shaw resolved LUCENENET-30.
-------------------------------
Resolution: Fixed
Yep, looks good, thanks!
> 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.
[jira] Commented: (LUCENENET-30) Unnecessary boxing of bytes
Posted by "George Aroush (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479860 ]
George Aroush commented on LUCENENET-30:
----------------------------------------
Hi Joe,
Sorry, my bad. This is fixed; it got in through another commit that I made. Here is the commit: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/SegmentReader.cs?view=diff&r1=516734&r2=516735&pathrev=516735
Can you confirm and then close this issue?
Thanks!
-- George Aroush
> 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.
[jira] Assigned: (LUCENENET-30) Unnecessary boxing of bytes
Posted by "George Aroush (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
George Aroush reassigned LUCENENET-30:
--------------------------------------
Assignee: George Aroush
> 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.
[jira] Closed: (LUCENENET-30) Unnecessary boxing of bytes
Posted by "George Aroush (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
George Aroush closed LUCENENET-30.
----------------------------------
Already delivered to Lucene.Net 2.1 build 003
> 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.
[jira] Resolved: (LUCENENET-30) Unnecessary boxing of bytes
Posted by "George Aroush (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Reopened: (LUCENENET-30) Unnecessary boxing of bytes
Posted by "Joe Shaw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENENET-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joe Shaw reopened LUCENENET-30:
-------------------------------
I'm reopening this issue, because the commit above doesn't contain any changes to the SegmentReader. George, did you perhaps miss the file in your commit?
> 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.