You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Michael Garski (JIRA)" <ji...@apache.org> on 2009/11/12 06:41:39 UTC

[jira] Closed: (LUCENENET-232) Inlining Unsigned Right Shift

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

Michael Garski closed LUCENENET-232.
------------------------------------

    Resolution: Won't Fix

> Inlining Unsigned Right Shift
> -----------------------------
>
>                 Key: LUCENENET-232
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-232
>             Project: Lucene.Net
>          Issue Type: Improvement
>            Reporter: Michael Garski
>            Priority: Minor
>
> As .NET does not have an unisgned right shift operator (>>>) as Java does, two overloads of SupportClass.Number.URShift exist to perform the operation for longs and ints.  The original Java conversion spit out an incorrect implementation:
> The converted implementation is:
> {code}
> if (number >= 0)
>     return number >> bits;
> else
>     return (number >> bits) + (2 << ~bits);
> {code}
> The correct implementation is:
> {code}
> (long)(((ulong)number) >> bits);
> {code}
> I submitted a patch for LUCENENET-230 that corrects the implementation, however the shifting should be in-lined as opposed to broken out in a method to remain performant.  This issue will cover the in-lining.
> I'm marking this as a minor improvement at this time as I have not measured the performance impact.

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