rustdoc-search: make type name correction choice deterministic

This commit is contained in:
Michael Howell 2023-04-20 12:34:17 -07:00
parent e0a7462d2f
commit 7529d87407

View File

@ -1609,6 +1609,9 @@ function initSearch(rawSearchIndex) {
for (const [name, id] of typeNameIdMap) {
const dist = editDistance(name, elem.name, maxEditDistance);
if (dist <= matchDist && dist <= maxEditDistance) {
if (dist === matchDist && matchName > name) {
continue;
}
match = id;
matchDist = dist;
matchName = name;