mirror of https://github.com/apache/lucene.git
LUCENE-6076: Remove unnecessary copy (thanks Robert for pointing this out).
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1641824 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
86e6db22f7
commit
a03adb85ea
|
@ -149,10 +149,9 @@ public class CachingWrapperFilter extends Filter implements Accountable {
|
||||||
@Override
|
@Override
|
||||||
public Iterable<? extends Accountable> getChildResources() {
|
public Iterable<? extends Accountable> getChildResources() {
|
||||||
// Sync to pull the current set of values:
|
// Sync to pull the current set of values:
|
||||||
final Map<Object, DocIdSet> copy;
|
|
||||||
synchronized (cache) {
|
synchronized (cache) {
|
||||||
copy = new HashMap<>(cache);
|
// no need to clone, Accountable#namedAccountables already copies the data
|
||||||
|
return Accountables.namedAccountables("segment", cache);
|
||||||
}
|
}
|
||||||
return Accountables.namedAccountables("segment", copy);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue