From 30eb459a358cba9a8bd6adb81d49bee83646cd14 Mon Sep 17 00:00:00 2001 From: Nikita Katkov Date: Fri, 21 Jun 2024 10:31:00 +0200 Subject: [PATCH] Revert "[json] IJPL-157032 Prefer storing resolved tree nodes in a set to avoid processing the effective same branches multiple times" This reverts commit 14f06c419ff394383dd974da36c34da91b8c488a. The change in the MatchResult cannot be used so far because ancient allOf/anyOf resolve relies on having several equal-by-pointer json schema objects in a collection. GitOrigin-RevId: 48bda04351f25fd783d1e051bf61115876e0739e --- json/src/com/jetbrains/jsonSchema/impl/MatchResult.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/json/src/com/jetbrains/jsonSchema/impl/MatchResult.java b/json/src/com/jetbrains/jsonSchema/impl/MatchResult.java index 2df070985528..823c111227f1 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/MatchResult.java +++ b/json/src/com/jetbrains/jsonSchema/impl/MatchResult.java @@ -2,7 +2,6 @@ package com.jetbrains.jsonSchema.impl; import com.intellij.util.Processor; -import com.intellij.util.SmartList; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import org.jetbrains.annotations.NotNull; @@ -13,13 +12,13 @@ public final class MatchResult { public final List mySchemas; public final List> myExcludingSchemas; - private MatchResult(final @NotNull Collection schemas, final @NotNull List> excludingSchemas) { - mySchemas = Collections.unmodifiableList(new SmartList<>(schemas)); + private MatchResult(final @NotNull List schemas, final @NotNull List> excludingSchemas) { + mySchemas = Collections.unmodifiableList(schemas); myExcludingSchemas = Collections.unmodifiableList(excludingSchemas); } public static MatchResult create(@NotNull JsonSchemaTreeNode root) { - Collection schemas = new LinkedHashSet<>(); + List schemas = new ArrayList<>(); Int2ObjectMap> oneOfGroups = new Int2ObjectOpenHashMap<>(); iterateTree(root, node -> { if (node.isAny()) return true;