[performance optimization] use VirtualFile.getNameSequence() instead of VirtualFile...
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Mon, 19 Jan 2015 19:03:31 +0000 (20:03 +0100)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Mon, 19 Jan 2015 19:03:31 +0000 (20:03 +0100)
platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java
platform/vcs-api/src/com/intellij/openapi/vcs/changes/IgnoredFileBean.java
python/src/com/jetbrains/python/psi/stubs/PySetuptoolsNamespaceIndex.java

index b1c3d90a8aedddf319111dbf31dce9a656e7bcd1..bf91a747b94888d39ff7747c6c0754496f9f8277 100644 (file)
@@ -1323,7 +1323,7 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone
     @NotNull
     @Override
     public CharSequence getNameSequence() {
-      return myParentLocalFile.getName();
+      return myParentLocalFile.getNameSequence();
     }
 
     @Override
index 1091f908b600ad4841ef9be84bcf3681258e50a6..2245b5eae90b2bfa0e46d13e60cf945b8f55c1ee 100644 (file)
@@ -25,6 +25,7 @@ package com.intellij.openapi.vcs.changes;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.vfs.LocalFileSystem;
 import com.intellij.openapi.vfs.VfsUtilCore;
 import com.intellij.openapi.vfs.VirtualFile;
@@ -119,7 +120,7 @@ public class IgnoredFileBean {
     }
     else {
       // quick check for 'file' == exact match pattern
-      if (IgnoreSettingsType.FILE.equals(myType) && !myFilenameIfFile.equals(file.getName())) return false;
+      if (IgnoreSettingsType.FILE.equals(myType) && !StringUtil.equals(myFilenameIfFile, file.getNameSequence())) return false;
 
       VirtualFile selector = resolve();
       if (Comparing.equal(selector, NullVirtualFile.INSTANCE)) return false;
index 2988922415d21ade35303d86bdf6f38c1f3166aa..a0bf1cceb943518a866dc9551904f6a579d05ff6 100644 (file)
@@ -16,6 +16,7 @@
 package com.jetbrains.python.psi.stubs;
 
 import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.util.indexing.*;
@@ -58,7 +59,7 @@ public class PySetuptoolsNamespaceIndex extends ScalarIndexExtension<String> {
   private FileBasedIndex.InputFilter myInputFilter = new FileBasedIndex.InputFilter() {
     @Override
     public boolean acceptInput(@NotNull VirtualFile file) {
-      return file.getName().endsWith(NAMESPACE_FILE_SUFFIX);
+      return StringUtil.endsWith(file.getNameSequence(), NAMESPACE_FILE_SUFFIX);
     }
   };