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/06 20:09:19 UTC

[jira] [Created] (LUCENE-5044) wasted work in AllGroupHeadsCollectorTest.arrayContains()

Adrian Nistor created LUCENE-5044:
-------------------------------------

             Summary: wasted work in AllGroupHeadsCollectorTest.arrayContains()
                 Key: LUCENE-5044
                 URL: https://issues.apache.org/jira/browse/LUCENE-5044
             Project: Lucene - Core
          Issue Type: Bug
    Affects Versions: 4.3
         Environment: any
            Reporter: Adrian Nistor
            Priority: Minor
         Attachments: patch.diff

The problem appears in version 4.3.0 and in revision 1490286.  I
attached a one-line patch that fixes it.

In method "AllGroupHeadsCollectorTest.arrayContains", the loop over
"actual" should break immediately after "found" is set to "true".  All
the iterations after "found" is set to "true" do not perform any
useful work, at best they just set "found" again to "true".

Method "processWord" in class "CapitalizationFilter" has a similar
loop (over "prefix"), and this loop breaks immediately after "match"
is set to "false", just like in the proposed patch.  Other methods
(e.g., "Step.apply", "JapaneseTokenizer.computePenalty",
"CompressingStoredFieldsWriter.saveInts", "FieldQuery.checkOverlap")
also have similar loops with similar breaks, just like in the proposed
patch.

--
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