Archived
0

fix sort routers

This commit is contained in:
iMoHax
2014-08-25 17:42:11 +04:00
parent aa5f581df5
commit b3bd22b99d
2 changed files with 75 additions and 2 deletions

View File

@@ -35,8 +35,8 @@ public class RouteGraph extends Graph<Vendor> {
route.sort(balance, limit);
if (paths.size() == max){
int index = Collections.binarySearch(paths, route, comparator);
if (index == -1) return false;
if (index < -1) index = -1 - index;
if (index < 0) index = -1 - index;
if (index == max) return false;
paths.add(index, path);
paths.remove(max);