From 02000c4f6ecbfb41993d3b9424d0bb144dac7fa3 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Tue, 28 Aug 2018 00:21:33 +0300 Subject: [PATCH] Avoid unnecessary ElementClass validation work GraphToDiagramSynchronizer.SubstituteElementClassImpl can safely ignore ElementClass validation checks which speeds loading up a bit for very large diagrams. gitlab #90 Change-Id: I2aa561cbad8de034362a4a298272d3faa8242537 (cherry picked from commit bb2be932187c70082a01e12e1f451dd06650a48c) --- .../simantics/diagram/adapter/GraphToDiagramSynchronizer.java | 2 +- .../src/org/simantics/g2d/element/ElementClass.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java index dd6c9b7d1..fa4a280ce 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java @@ -762,7 +762,7 @@ public class GraphToDiagramSynchronizer extends AbstractDisposable implements ID else result.add(eh); } - return ElementClass.compile(result).setId(ec.getId()); + return ElementClass.compile(result, false).setId(ec.getId()); } } diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementClass.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementClass.java index aaea7654d..5d6897601 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementClass.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementClass.java @@ -93,13 +93,11 @@ public final class ElementClass extends AbstractHandlerClass { */ public static ElementClass compile(Collection contributions) { - assertClassValid(contributions); return new ElementClass(contributions); } public static ElementClass compile(Collection contributions, boolean check) { - if(check) assertClassValid(contributions); return new ElementClass(contributions, check); } -- 2.47.1