]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Avoid unnecessary ElementClass validation work 39/2039/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 27 Aug 2018 21:21:33 +0000 (00:21 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 27 Aug 2018 21:21:33 +0000 (00:21 +0300)
GraphToDiagramSynchronizer.SubstituteElementClassImpl can safely ignore
ElementClass validation checks which speeds loading up a bit for very
large diagrams.

gitlab #90

Change-Id: I2aa561cbad8de034362a4a298272d3faa8242537

bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java
bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementClass.java

index 9be80c34e9c1d8c611a762e851a866dea62e0c3d..2b72b3e0f9a8ee1133ea853484c94a60d89f3dc4 100644 (file)
@@ -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());
         }
     }
 
index aaea7654d6874d0f03b7b0db01f990ca8e1e83d8..5d689760143772252b0407340e48620c6bb55e4f 100644 (file)
@@ -93,13 +93,11 @@ public final class ElementClass extends AbstractHandlerClass<ElementHandler> {
      */
     public static ElementClass compile(Collection<ElementHandler> contributions)
     {
-        assertClassValid(contributions);
         return new ElementClass(contributions);
     }
 
     public static ElementClass compile(Collection<ElementHandler> contributions, boolean check)
     {
-        if(check) assertClassValid(contributions);
         return new ElementClass(contributions, check);
     }