mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 21:47:04 +00:00
rustdoc-search: make type name correction choice deterministic
This commit is contained in:
parent
e0a7462d2f
commit
7529d87407
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user