Linkgraph: Use cached value in capacity annotation comparison
This commit is contained in:
@@ -253,7 +253,7 @@ bool CapacityAnnotation::IsBetter(const CapacityAnnotation *base, uint cap,
|
|||||||
int free_cap, uint dist) const
|
int free_cap, uint dist) const
|
||||||
{
|
{
|
||||||
int min_cap = Path::GetCapacityRatio(min(base->free_capacity, free_cap), min(base->capacity, cap));
|
int min_cap = Path::GetCapacityRatio(min(base->free_capacity, free_cap), min(base->capacity, cap));
|
||||||
int this_cap = this->GetCapacityRatio();
|
int this_cap = this->GetAnnotation();
|
||||||
if (min_cap == this_cap) {
|
if (min_cap == this_cap) {
|
||||||
/* If the capacities are the same and the other path isn't disconnected
|
/* If the capacities are the same and the other path isn't disconnected
|
||||||
* choose the shorter path. */
|
* choose the shorter path. */
|
||||||
|
Reference in New Issue
Block a user