From 81bb4e0913e3b32a6a4d2ce2d64a16b6db73f372 Mon Sep 17 00:00:00 2001 From: "peter.gromov" Date: Fri, 12 Nov 2010 18:56:00 +0300 Subject: [PATCH] much faster property search (thanks to Nik pointing out that I'm not able to write intersection correctly from the first time) --- .../com/intellij/psi/impl/search/PsiSearchHelperImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java index 28fef28a9ba1..2c3c9fc6c6f1 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java @@ -646,10 +646,9 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { first = false; } else { - for (VirtualFile file : local.keySet()) { - if (intersection.containsKey(file)) { - intersection.putValues(file, local.get(file)); - } + intersection.keySet().retainAll(local.keySet()); + for (VirtualFile file : intersection.keySet()) { + intersection.get(file).retainAll(local.get(file)); } } }