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

Michael McCandless commented on LUCENE-6014:
--------------------------------------------

+1 to just nuke this scary optimization.

It's really important our core code is easy to understand, to reduce chance of 
bugs, and so other "non experts" can look, find bugs, make improvements.

And so if this crazy opto is hard for you (who I would say has a strong grasp 
of postings formats in general) to figure out w/o comments, I don't think even 
with comments it ought 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