cleanup: deadcode
authorDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Wed, 12 Aug 2020 06:45:24 +0000 (09:45 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Wed, 12 Aug 2020 07:02:58 +0000 (07:02 +0000)
GitOrigin-RevId: 39bbf91a4b769f4a36ec3aa48b38e90810091743

platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java
platform/lang-impl/src/com/intellij/util/indexing/IndexConfiguration.java

index 7378fb0a963577a23dfbbf26ec4d4e9917670a19..637563a1a3dd4482e79012bca2db545669c909a4 100644 (file)
@@ -866,24 +866,22 @@ public final class FileBasedIndexImpl extends FileBasedIndexEx {
     }
 
     Collection<Document> documents = getUnsavedDocuments();
-    if(true) {
-      Set<Document> transactedDocuments = getTransactedDocuments();
-      if (documents.isEmpty()) {
-        documents = transactedDocuments;
-      }
-      else if (!transactedDocuments.isEmpty()) {
-        documents = new HashSet<>(documents);
-        documents.addAll(transactedDocuments);
-      }
-      Document[] uncommittedDocuments = project != null ? PsiDocumentManager.getInstance(project).getUncommittedDocuments() : Document.EMPTY_ARRAY;
-      if (uncommittedDocuments.length > 0) {
-        List<Document> uncommittedDocumentsCollection = Arrays.asList(uncommittedDocuments);
-        if (documents.isEmpty()) documents = uncommittedDocumentsCollection;
-        else {
-          if (!(documents instanceof HashSet)) documents = new HashSet<>(documents);
+    Set<Document> transactedDocuments = getTransactedDocuments();
+    if (documents.isEmpty()) {
+      documents = transactedDocuments;
+    }
+    else if (!transactedDocuments.isEmpty()) {
+      documents = new HashSet<>(documents);
+      documents.addAll(transactedDocuments);
+    }
+    Document[] uncommittedDocuments = project != null ? PsiDocumentManager.getInstance(project).getUncommittedDocuments() : Document.EMPTY_ARRAY;
+    if (uncommittedDocuments.length > 0) {
+      List<Document> uncommittedDocumentsCollection = Arrays.asList(uncommittedDocuments);
+      if (documents.isEmpty()) documents = uncommittedDocumentsCollection;
+      else {
+        if (!(documents instanceof HashSet)) documents = new HashSet<>(documents);
 
-          documents.addAll(uncommittedDocumentsCollection);
-        }
+        documents.addAll(uncommittedDocumentsCollection);
       }
     }
 
index 6df3afeb0c416652e086ec89b28425e6c8459d74..74b4e272e96bdd71d42bcdddc8729ae98b3f4072 100644 (file)
@@ -89,11 +89,6 @@ final class IndexConfiguration {
     return myIndices.keySet();
   }
 
-  boolean hasIndex(@NotNull ID<?, ?> name) {
-    assert myFreezed;
-    return myIndices.containsKey(name);
-  }
-
   int getIndexVersion(@NotNull ID<?, ?> id) {
     assert myFreezed;
     return myIndexIdToVersionMap.getInt(id);