ByteArray: do not instantiate arrays if not needed 42/35942/2
authorRobert Varga <rovarga@cisco.com>
Wed, 24 Feb 2016 19:41:03 +0000 (20:41 +0100)
committerMilos Fabian <milfabia@cisco.com>
Tue, 8 Mar 2016 22:09:04 +0000 (22:09 +0000)
commit878f6c541d6ffac91c0b68da647690749a9ca5fd
tree9b2000dfb2100f86ee710b9d4caa996343673e49
parent8c55e1b1b94b22615d626c8d28a8272631204116
ByteArray: do not instantiate arrays if not needed

Move array instantiation into the block where it is used, skipping it
completely in the case we have properly-sized array.

Change-Id: Ie5027f429830a39bfd2835cc5751cb3d6c27dd1e
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 439698fb6b677d9c3e121a0031499b4c68b59c20)
util/src/main/java/org/opendaylight/protocol/util/ByteArray.java