Linkgraph: Use cached value in capacity annotation comparison

This commit is contained in:
Jonathan G Rennison
2018-01-15 18:24:44 +00:00
parent e54a7189fd
commit 4a420ef864

View File

@@ -253,7 +253,7 @@ bool CapacityAnnotation::IsBetter(const CapacityAnnotation *base, uint cap,
int free_cap, uint dist) const
{
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 the capacities are the same and the other path isn't disconnected
* choose the shorter path. */