[ https://issues.apache.org/jira/browse/LUCENE-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shai Erera updated LUCENE-3637: ------------------------------- Attachment: LUCENE-3637.patch Very trivial patch. If there are no objections, I'd like to commit this. > Make IndexReader.decRef() call refCount.decrementAndGet instead of > getAndDecrement > ---------------------------------------------------------------------------------- > > Key: LUCENE-3637 > URL: https://issues.apache.org/jira/browse/LUCENE-3637 > Project: Lucene - Java > Issue Type: Improvement > Components: core/search > Reporter: Shai Erera > Priority: Trivial > Fix For: 3.6, 4.0 > > Attachments: LUCENE-3637.patch > > > IndexReader.decRef() has this code: > {code} > final int rc = refCount.getAndDecrement(); > if (rc == 1) { > {code} > I think it will be clearer if it was written like this: > {code} > final int rc = refCount.decrementAndGet(); > if (rc == 0) { > {code} > It's a very simple change, which makes reading the code (at least IMO) > easier. Will post a patch shortly. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org