@@ -463,11 +463,10 @@ function initSearch(rawSearchIndex) {
463
463
* @param {ParserState } parserState
464
464
*/
465
465
function parseInput ( query , parserState ) {
466
- let c , before ;
467
466
let foundStopChar = true ;
468
467
469
468
while ( parserState . pos < parserState . length ) {
470
- c = parserState . userQuery [ parserState . pos ] ;
469
+ const c = parserState . userQuery [ parserState . pos ] ;
471
470
if ( isStopCharacter ( c ) ) {
472
471
foundStopChar = true ;
473
472
if ( isSeparatorCharacter ( c ) ) {
@@ -506,7 +505,7 @@ function initSearch(rawSearchIndex) {
506
505
}
507
506
throw new Error ( `Expected \`,\`, \` \`, \`:\` or \`->\`, found \`${ c } \`` ) ;
508
507
}
509
- before = query . elems . length ;
508
+ const before = query . elems . length ;
510
509
getNextElem ( query , parserState , query . elems , false ) ;
511
510
if ( query . elems . length === before ) {
512
511
// Nothing was added, weird... Let's increase the position to not remain stuck.
@@ -515,7 +514,6 @@ function initSearch(rawSearchIndex) {
515
514
foundStopChar = false ;
516
515
}
517
516
while ( parserState . pos < parserState . length ) {
518
- c = parserState . userQuery [ parserState . pos ] ;
519
517
if ( isReturnArrow ( parserState ) ) {
520
518
parserState . pos += 2 ;
521
519
// Get returned elements.
@@ -1940,7 +1938,6 @@ function initSearch(rawSearchIndex) {
1940
1938
*/
1941
1939
const searchWords = [ ] ;
1942
1940
const charA = "A" . charCodeAt ( 0 ) ;
1943
- let i , word ;
1944
1941
let currentIndex = 0 ;
1945
1942
let id = 0 ;
1946
1943
@@ -2035,7 +2032,7 @@ function initSearch(rawSearchIndex) {
2035
2032
// convert `rawPaths` entries into object form
2036
2033
// generate normalizedPaths for function search mode
2037
2034
let len = paths . length ;
2038
- for ( i = 0 ; i < len ; ++ i ) {
2035
+ for ( let i = 0 ; i < len ; ++ i ) {
2039
2036
lowercasePaths . push ( { ty : paths [ i ] [ 0 ] , name : paths [ i ] [ 1 ] . toLowerCase ( ) } ) ;
2040
2037
paths [ i ] = { ty : paths [ i ] [ 0 ] , name : paths [ i ] [ 1 ] } ;
2041
2038
}
@@ -2049,16 +2046,14 @@ function initSearch(rawSearchIndex) {
2049
2046
// faster analysis operations
2050
2047
len = itemTypes . length ;
2051
2048
let lastPath = "" ;
2052
- for ( i = 0 ; i < len ; ++ i ) {
2049
+ for ( let i = 0 ; i < len ; ++ i ) {
2050
+ let word = "" ;
2053
2051
// This object should have exactly the same set of fields as the "crateRow"
2054
2052
// object defined above.
2055
2053
if ( typeof itemNames [ i ] === "string" ) {
2056
2054
word = itemNames [ i ] . toLowerCase ( ) ;
2057
- searchWords . push ( word ) ;
2058
- } else {
2059
- word = "" ;
2060
- searchWords . push ( "" ) ;
2061
2055
}
2056
+ searchWords . push ( word ) ;
2062
2057
const row = {
2063
2058
crate : crate ,
2064
2059
ty : itemTypes . charCodeAt ( i ) - charA ,
0 commit comments