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
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: [email protected]
For additional commands, e-mail: [email protected]