mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
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
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f587af6ada
commit
30eb459a35
@@ -2,7 +2,6 @@
|
|||||||
package com.jetbrains.jsonSchema.impl;
|
package com.jetbrains.jsonSchema.impl;
|
||||||
|
|
||||||
import com.intellij.util.Processor;
|
import com.intellij.util.Processor;
|
||||||
import com.intellij.util.SmartList;
|
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -13,13 +12,13 @@ public final class MatchResult {
|
|||||||
public final List<JsonSchemaObject> mySchemas;
|
public final List<JsonSchemaObject> mySchemas;
|
||||||
public final List<Collection<? extends JsonSchemaObject>> myExcludingSchemas;
|
public final List<Collection<? extends JsonSchemaObject>> myExcludingSchemas;
|
||||||
|
|
||||||
private MatchResult(final @NotNull Collection<JsonSchemaObject> schemas, final @NotNull List<Collection<? extends JsonSchemaObject>> excludingSchemas) {
|
private MatchResult(final @NotNull List<JsonSchemaObject> schemas, final @NotNull List<Collection<? extends JsonSchemaObject>> excludingSchemas) {
|
||||||
mySchemas = Collections.unmodifiableList(new SmartList<>(schemas));
|
mySchemas = Collections.unmodifiableList(schemas);
|
||||||
myExcludingSchemas = Collections.unmodifiableList(excludingSchemas);
|
myExcludingSchemas = Collections.unmodifiableList(excludingSchemas);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MatchResult create(@NotNull JsonSchemaTreeNode root) {
|
public static MatchResult create(@NotNull JsonSchemaTreeNode root) {
|
||||||
Collection<JsonSchemaObject> schemas = new LinkedHashSet<>();
|
List<JsonSchemaObject> schemas = new ArrayList<>();
|
||||||
Int2ObjectMap<List<JsonSchemaObject>> oneOfGroups = new Int2ObjectOpenHashMap<>();
|
Int2ObjectMap<List<JsonSchemaObject>> oneOfGroups = new Int2ObjectOpenHashMap<>();
|
||||||
iterateTree(root, node -> {
|
iterateTree(root, node -> {
|
||||||
if (node.isAny()) return true;
|
if (node.isAny()) return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user