dvRouteMatchesFirst function
Whether a has to be matched before b: they meet, and at the first
segment where they differ in kind, a is the more specific.
Implementation
bool dvRouteMatchesFirst(String a, String b) {
if (!dvRoutesOverlap(a, b)) return false;
final List<String> left = _segments(a);
final List<String> right = _segments(b);
final int length = left.length > right.length ? left.length : right.length;
for (int i = 0; i < length; i++) {
final int l = i < left.length ? _rank(left[i]) : -1;
final int r = i < right.length ? _rank(right[i]) : -1;
if (l != r) return l < r;
}
return false;
}