@@ -1833,18 +1833,12 @@ function defocusSearchBar() {
18331833 showResults ( execSearch ( query , index , filterCrates ) ) ;
18341834 }
18351835
1836- function generateId ( ty ) {
1837- if ( ty . parent && ty . parent . name ) {
1838- return itemTypes [ ty . ty ] + ty . path + ty . parent . name + ty . name ;
1839- }
1840- return itemTypes [ ty . ty ] + ty . path + ty . name ;
1841- }
1842-
18431836 function buildIndex ( rawSearchIndex ) {
18441837 searchIndex = [ ] ;
18451838 var searchWords = [ ] ;
18461839 var i ;
18471840 var currentIndex = 0 ;
1841+ var id = 0 ;
18481842
18491843 for ( var crate in rawSearchIndex ) {
18501844 if ( ! hasOwnProperty ( rawSearchIndex , crate ) ) { continue ; }
@@ -1866,10 +1860,10 @@ function defocusSearchBar() {
18661860 desc : rawSearchIndex [ crate ] . doc ,
18671861 parent : undefined ,
18681862 type : null ,
1869- id : "" ,
1863+ id : id ,
18701864 nameWithoutUnderscores : nameWithoutUnderscores ,
18711865 } ;
1872- crateRow . id = generateId ( crateRow ) ;
1866+ id += 1 ;
18731867 searchIndex . push ( crateRow ) ;
18741868 currentIndex += 1 ;
18751869
@@ -1921,10 +1915,10 @@ function defocusSearchBar() {
19211915 desc : itemDescs [ i ] ,
19221916 parent : itemParentIdxs [ i ] > 0 ? paths [ itemParentIdxs [ i ] - 1 ] : undefined ,
19231917 type : itemFunctionSearchTypes [ i ] ,
1924- id : "" ,
1918+ id : id ,
19251919 nameWithoutUnderscores : nameWithoutUnderscores ,
19261920 } ;
1927- row . id = generateId ( row ) ;
1921+ id += 1 ;
19281922 searchIndex . push ( row ) ;
19291923 if ( typeof row . name === "string" ) {
19301924 var word = row . name . toLowerCase ( ) ;
0 commit comments