mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use ValueIterator class to be able to get file set associated with given value without hash map lookup with m.b. costly hash code calculation
This commit is contained in:
@@ -1142,13 +1142,13 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
final TIntHashSet copy = new TIntHashSet();
|
||||
final ValueContainer<V> container = index.getData(dataKey);
|
||||
|
||||
for (final Iterator<V> valueIt = container.getValueIterator(); valueIt.hasNext(); ) {
|
||||
for (final ValueContainer.ValueIterator<V> valueIt = container.getValueIterator(); valueIt.hasNext(); ) {
|
||||
final V value = valueIt.next();
|
||||
if (valueChecker != null && !valueChecker.value(value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ValueContainer.IntIterator iterator = container.getInputIdsIterator(value);
|
||||
ValueContainer.IntIterator iterator = valueIt.getInputIdsIterator();
|
||||
|
||||
if (mainIntersection == null || iterator.size() < mainIntersection.size()) {
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1162,7 +1162,7 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
}
|
||||
else {
|
||||
mainIntersection.forEach(new TIntProcedure() {
|
||||
final ValueContainer.IntPredicate predicate = container.getValueAssociationPredicate(value);
|
||||
final ValueContainer.IntPredicate predicate = valueIt.getValueAssociationPredicate();
|
||||
|
||||
@Override
|
||||
public boolean execute(int id) {
|
||||
|
||||
@@ -75,9 +75,9 @@ public abstract class ValueContainer<Value> {
|
||||
}
|
||||
|
||||
public final boolean forEach(@NotNull ContainerAction<Value> action) {
|
||||
for (final Iterator<Value> valueIterator = getValueIterator(); valueIterator.hasNext();) {
|
||||
for (final ValueIterator<Value> valueIterator = getValueIterator(); valueIterator.hasNext();) {
|
||||
final Value value = valueIterator.next();
|
||||
for (final IntIterator intIterator = getInputIdsIterator(value); intIterator.hasNext();) {
|
||||
for (final IntIterator intIterator = valueIterator.getInputIdsIterator(); intIterator.hasNext();) {
|
||||
if (!action.perform(intIterator.next(), value)) return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user