You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Adrian Nistor (JIRA)" <ji...@apache.org> on 2013/06/29 23:30:20 UTC

[jira] [Created] (LUCENE-5083) Wasted work in FuzzySet.getNearestSetSize

Adrian Nistor created LUCENE-5083:
-------------------------------------

             Summary: Wasted work in FuzzySet.getNearestSetSize
                 Key: LUCENE-5083
                 URL: https://issues.apache.org/jira/browse/LUCENE-5083
             Project: Lucene - Core
          Issue Type: Bug
          Components: core/codecs
    Affects Versions: 4.3.1
         Environment: any
            Reporter: Adrian Nistor
            Priority: Minor
         Attachments: patch.diff

The problem appears in version 4.3.1 and in revision 1498027.  I
attached a two-line patch that fixes it.

In method "FuzzySet.getNearestSetSize", the loop over
"usableBitSetSizes" keeps overriding "result" with
"usableBitSetSizes[i]".  Therefore, only the last written value is
visible out of the loop and all the other writes and iterations are
not necessary.  The patch iterates from the end of "usableBitSetSizes"
and breaks the first time when "result" is set.

--
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: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org