]> git.lizzy.rs Git - rust.git/commitdiff
Improve results a bit
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 15 Dec 2017 14:42:38 +0000 (15:42 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 15 Dec 2017 14:42:38 +0000 (15:42 +0100)
src/librustdoc/html/static/main.js

index 0c775f2a58e287e7c8fcced5d9d810efb3513412..1b9035367f7e246e894ec1d734a4759269701898 100644 (file)
                     }
 
                     lev += lev_add;
-                    if (searchWords[j].startsWith(val)) {
-                        lev -= 1;
+                    if (lev > 0 && val.length > 3 && searchWords[j].startsWith(val)) {
+                        if (val.length < 6) {
+                            lev -= 1;
+                        } else {
+                            lev = 0;
+                        }
                     }
                     if (in_args <= MAX_LEV_DISTANCE) {
                         if (results_in_args[fullId] === undefined) {