Optimization - calculate the subnet prefix only once. 24/3924/2
authorAlissa Bonas <abonas@redhat.com>
Wed, 25 Dec 2013 17:23:33 +0000 (19:23 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 22 Jan 2014 21:04:29 +0000 (21:04 +0000)
commit795acce15158be694bbc8a580ff2feda4cf0b555
tree04369fed5fc7f71b4727ce249c08e46fd4b1cee6
parent99f9aa0ea003f3a8cc28dfef73b1b38a13e19039
Optimization - calculate the subnet prefix only once.

Before this change, subnet prefix was calculated on every
'isSubnetOf' call. Since the prefix is not changing unless
the subnet address itself changed, it's sufficient to do it only once
and keep it as part of the Subnet object.

Marked it as transient so it will not be serialized - it can be
calculated from the rest of the info of Subnet anytime after
deserialization.

Change-Id: Ie16bf80713820b566864bea0ff46298c93cc2d47
Signed-off-by: Alissa Bonas <abonas@redhat.com>
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Subnet.java