# HG changeset patch # User Chris Cannam # Date 1417103772 0 # Node ID 8b33cb568b109d70d32f8b793ac6be24d14daea3 # Parent c665173b3a3369c2ceb540f90bd98ee0331173b7 Fix inconsistency (with Finder) in choice of preference where two costs come out equal diff -r c665173b3a33 -r 8b33cb568b10 src/Matcher.cpp --- a/src/Matcher.cpp Thu Nov 27 15:29:43 2014 +0000 +++ b/src/Matcher.cpp Thu Nov 27 15:56:12 2014 +0000 @@ -337,8 +337,13 @@ double cost1 = min1 + distance; double cost2 = min2 + distance; double cost3 = min3 + diagDistance; + + // Choosing is easy if there is a strict cheapest of the + // three. If two or more share the lowest cost, we choose + // in order of preference: cost3 (AdvanceBoth), cost2 + // (AdvanceThis), cost1 (AdvanceOther). - if (cost1 <= cost2) { + if (cost1 < cost2) { if (cost3 <= cost1) { updateValue(m_frameCount, index, AdvanceBoth, min3, distance);