From 0a108fe06e3324973a6f8029f597249967cfbb1b Mon Sep 17 00:00:00 2001 From: Dmitro Batko Date: Tue, 10 Mar 2020 11:38:41 +0300 Subject: [PATCH] indexes: allow to process inline keys for every index storage (only testing purposes) GitOrigin-RevId: 0fc3d02aabe827b34957a91012f905c7fcb01f4c --- .../util/indexing/VfsAwareMapIndexStorage.java | 7 ------- .../intellij/util/indexing/impl/MapIndexStorage.java | 10 +++++++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/VfsAwareMapIndexStorage.java b/platform/lang-impl/src/com/intellij/util/indexing/VfsAwareMapIndexStorage.java index eed8d2494fcd..a96cf56b3221 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/VfsAwareMapIndexStorage.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/VfsAwareMapIndexStorage.java @@ -239,13 +239,6 @@ public final class VfsAwareMapIndexStorage extends MapIndexStorage processor) throws IOException { - return myMap instanceof PersistentHashMap && myKeyDescriptor instanceof InlineKeyDescriptor - // process keys and check that they're already present in map because we don't have separated key storage we must check keys - ? ((PersistentHashMap>)myMap).processKeysWithExistingMapping(processor) - // optimization: process all keys, some of them might be already deleted but we don't care. We just read key storage file here - : myMap.processKeys(processor); - } @NotNull private static TIntHashSet loadHashedIds(@NotNull File fileWithCaches) throws IOException { diff --git a/platform/util/src/com/intellij/util/indexing/impl/MapIndexStorage.java b/platform/util/src/com/intellij/util/indexing/impl/MapIndexStorage.java index 28228df1d86d..5a04556da62f 100644 --- a/platform/util/src/com/intellij/util/indexing/impl/MapIndexStorage.java +++ b/platform/util/src/com/intellij/util/indexing/impl/MapIndexStorage.java @@ -292,7 +292,7 @@ public abstract class MapIndexStorage implements IndexStorage implements IndexStorage processor) throws IOException { + return myMap instanceof PersistentHashMap && myKeyDescriptor instanceof InlineKeyDescriptor + // process keys and check that they're already present in map because we don't have separated key storage we must check keys + ? ((PersistentHashMap>)myMap).processKeysWithExistingMapping(processor) + // optimization: process all keys, some of them might be already deleted but we don't care. We just read key storage file here + : myMap.processKeys(processor); + } + @TestOnly public PersistentMap> getIndexMap() { return myMap;