Fix isFirstBestPath brain damage 80/78480/3
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 5 Dec 2018 21:26:28 +0000 (22:26 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 6 Dec 2018 01:38:55 +0000 (02:38 +0100)
commit65ebcbe997010759ae90aa9ce4a892cbce915aa3
tree5c164ac94edd4a00b41784f45543fd96425b780b
parentf12c3c15054b3ca649a851cd6b1f68520ee5fdd6
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