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

Robert Muir commented on LUCENE-6014:
-------------------------------------

As far as i can see, the assumption seems to be skipped || docFreq < blocksize. 
But if someone ever changes logic for advance, this can easily break (and its 
not clear to me yet, that it works for the "skipping from fresh docsenum", but 
maybe its ok).

In any case, needs docs to stay :)

> Lucene41PostingsReader.advance() doc scanning is buggy
> ------------------------------------------------------
>
>                 Key: LUCENE-6014
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6014
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>
> The "code duplication" here to optimize scanning to target after "possible 
> skipping" looks really buggy.
> For example, it never checks to refill buffer in the loop if it gets 
> exhausted. But the code gives no indication about why its safe for it to make 
> this assumption.
> If nobody understands why this optimization is allowed to make such a 
> shortcut, then please add a comment indicating why, with asserts tied to 
> exact specific constants in skipwriter (if applicable), otherwise i will 
> remove the optimization completely in 72 hours.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to