[ 
https://issues.apache.org/jira/browse/LUCENE-8758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16919581#comment-16919581
 ] 

ASF subversion and git services commented on LUCENE-8758:
---------------------------------------------------------

Commit ea67d9c8c65c6c883ef2ebb3c061fcc6b251a360 in lucene-solr's branch 
refs/heads/master from Amish Shah
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=ea67d9c ]

LUCENE-8758 Remove unused fields in QuadPrefixTree


> Class Field levelN is not populated correctly in QuadPrefixTree
> ---------------------------------------------------------------
>
>                 Key: LUCENE-8758
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8758
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/spatial-extras
>    Affects Versions: 4.0, 5.0, 6.0, 7.0, 8.0
>            Reporter: Dominic Page
>            Assignee: David Smiley
>            Priority: Trivial
>              Labels: beginner
>             Fix For: 8.x
>
>         Attachments: LUCENE-8758.patch
>
>
> QuadPrefixTree in Lucene prepopulates these arrays:
> {{levelW = new double[maxLevels];}}
> {{levelH = new double[maxLevels];}}
> {{*levelS = new int[maxLevels];*}}
> {{*levelN = new int[maxLevels];*}}
> Like this
> {{for (int i = 1; i < levelW.length; i++) {}}
> {{ levelW[i] = levelW[i - 1] / 2.0;}}
> {{ levelH[i] = levelH[i - 1] / 2.0;}}
> {{ *levelS[i] = levelS[i - 1] * 2;*}}
> {{ *levelN[i] = levelN[i - 1] * 4;*}}
> {{}}}
> The field
> {{levelN[]}}
> overflows after level 14 = 1073741824 where maxLevels is limited to 
> {{MAX_LEVELS_POSSIBLE = 50;}}
> The field levelN appears not to be used anywhere. Likewise, the field
> {{levelS[] }}
> is only used in the 
> {{printInfo}}
> method. I would propose either to remove both 
> {{levelN[],}}{{levelS[]}}
> or to change the datatype
> {{levelN = new long[maxLevels];}}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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

Reply via email to