Optimize Types instantiation
authorRobert Varga <rovarga@cisco.com>
Mon, 26 Jan 2015 17:08:36 +0000 (18:08 +0100)
committerRobert Varga <rovarga@cisco.com>
Tue, 27 Jan 2015 12:03:40 +0000 (13:03 +0100)
Instead of using Arrays.copyOf(), use a simple array clone -- it has
better performance characteristics.

Change-Id: I2261f54c2a867dd09fd2f2655a0665492489215f
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-generator-util/src/main/java/org/opendaylight/yangtools/binding/generator/util/Types.java

index 123287cf503249d1875d60f6da006ace646e9cee..afd5df2bc1f2df5d07b0e448e53eb9c7c38d5b23 100644 (file)
@@ -271,7 +271,7 @@ public final class Types {
         public ParametrizedTypeImpl(final Type rawType, final Type[] actTypes) {
             super(rawType.getPackageName(), rawType.getName());
             this.rawType = rawType;
-            this.actualTypes = Arrays.copyOf(actTypes, actTypes.length);
+            this.actualTypes = actTypes.clone();
         }
 
     }