]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Avoid unnecessary ElementClass validation work
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 27 Aug 2018 21:21:33 +0000 (00:21 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 1 Sep 2018 08:22:44 +0000 (11:22 +0300)
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)

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

index dd6c9b7d10f7e7e916264a30bc3f24af71180627..fa4a280ce83062c17803331e3d2dee126da3a9ba 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);
     }