Bypass array-based sort 46/58746/3
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 12 Jun 2017 15:21:42 +0000 (17:21 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 12 Jun 2017 23:29:48 +0000 (01:29 +0200)
This makes unneeded copies, move over to Iterable-based sort.

Change-Id: I58d4b6b31e4e7927c1139bc6e2920a4e783597f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/EffectiveSchemaContext.java

index d0a229a6f6dde6afd2cada0dde4854d5f552bb0e..b2ad0beb31257cba1d0a2876c61458487eec084c 100644 (file)
@@ -79,7 +79,7 @@ public final class EffectiveSchemaContext extends AbstractSchemaContext {
          * Instead of doing this on each invocation of getModules(), pre-compute
          * it once and keep it around -- better than the set we got in.
          */
-        this.modules = ImmutableSet.copyOf(ModuleDependencySort.sort(modules.toArray(new Module[modules.size()])));
+        this.modules = ImmutableSet.copyOf(ModuleDependencySort.sort(modules));
 
          /*
          * The most common lookup is from Namespace->Module.