optimization: fewer getInfoForFile() calls
[idea/community.git] / platform / core-impl / src / com / intellij / psi / search / ProjectScopeImpl.java
index 355e51f57409c0add31f91d834340691f8d82931..bfcf5794b1b96d3bc3131b5bf11aac80a93c1d26 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.psi.search;
 
-import com.intellij.injected.editor.VirtualFileWindow;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.UnloadedModuleDescription;
 import com.intellij.openapi.project.Project;
@@ -36,11 +35,7 @@ public class ProjectScopeImpl extends GlobalSearchScope {
 
   @Override
   public boolean contains(@NotNull VirtualFile file) {
-    if (file instanceof VirtualFileWindow) return true;
-
-    if (myFileIndex.isInLibraryClasses(file) && !myFileIndex.isInSourceContent(file)) return false;
-
-    return myFileIndex.isInContent(file);
+    return myFileIndex.isInContentExceptLibraryClassesWithoutSources(file);
   }
 
   @Override