Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5083

Wasted work in FuzzySet.getNearestSetSize

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.3.1
    • None
    • core/codecs
    • any

    • New, Patch Available

    Description

      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.

      Attachments

        1. patch.diff
          0.7 kB
          Adrian Nistor

        Activity

          People

            Unassigned Unassigned
            adriannistor Adrian Nistor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: