Fix isFirstBestPath brain damage 83/78483/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 5 Dec 2018 21:26:28 +0000 (22:26 +0100)
committerRobert Varga <nite@hq.sk>
Thu, 6 Dec 2018 02:28:26 +0000 (02:28 +0000)
commitfe63e18ffc03e3db21c372472af75e44320eeb93
treeb7cdbd5e3a8b479138130daf13ef3da73ceef771
parent0663fd7e1b4a86bf815a7a04555eef61d229dab7
Fix isFirstBestPath brain damage

Using a List.indexOf() followed by equality to 0 is ... inefficient
to say the least.

Kill isFirstBestPath() and use a simple check against the first path,
if the list is non-empty.

Also optimize list allocation and remove useless copying while we're
at it.

Change-Id: Ia1a48736ff363ab15776b9f188207720f23169e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/add/AddPathAbstractRouteEntry.java