@@ -245,49 +245,49 @@ function initSearch(rawSearchIndex) {
245
245
*
246
246
* @type {Map<string, {id: integer, assocOnly: boolean}> }
247
247
*/
248
- let typeNameIdMap ;
248
+ const typeNameIdMap = new Map ( ) ;
249
249
const ALIASES = new Map ( ) ;
250
250
251
251
/**
252
252
* Special type name IDs for searching by array.
253
253
*/
254
- let typeNameIdOfArray ;
254
+ const typeNameIdOfArray = buildTypeMapIndex ( "array" ) ;
255
255
/**
256
256
* Special type name IDs for searching by slice.
257
257
*/
258
- let typeNameIdOfSlice ;
258
+ const typeNameIdOfSlice = buildTypeMapIndex ( "slice" ) ;
259
259
/**
260
260
* Special type name IDs for searching by both array and slice (`[]` syntax).
261
261
*/
262
- let typeNameIdOfArrayOrSlice ;
262
+ const typeNameIdOfArrayOrSlice = buildTypeMapIndex ( "[]" ) ;
263
263
/**
264
264
* Special type name IDs for searching by tuple.
265
265
*/
266
- let typeNameIdOfTuple ;
266
+ const typeNameIdOfTuple = buildTypeMapIndex ( "tuple" ) ;
267
267
/**
268
268
* Special type name IDs for searching by unit.
269
269
*/
270
- let typeNameIdOfUnit ;
270
+ const typeNameIdOfUnit = buildTypeMapIndex ( "unit" ) ;
271
271
/**
272
272
* Special type name IDs for searching by both tuple and unit (`()` syntax).
273
273
*/
274
- let typeNameIdOfTupleOrUnit ;
274
+ const typeNameIdOfTupleOrUnit = buildTypeMapIndex ( "()" ) ;
275
275
/**
276
276
* Special type name IDs for searching `fn`.
277
277
*/
278
- let typeNameIdOfFn ;
278
+ const typeNameIdOfFn = buildTypeMapIndex ( "fn" ) ;
279
279
/**
280
280
* Special type name IDs for searching `fnmut`.
281
281
*/
282
- let typeNameIdOfFnMut ;
282
+ const typeNameIdOfFnMut = buildTypeMapIndex ( "fnmut" ) ;
283
283
/**
284
284
* Special type name IDs for searching `fnonce`.
285
285
*/
286
- let typeNameIdOfFnOnce ;
286
+ const typeNameIdOfFnOnce = buildTypeMapIndex ( "fnonce" ) ;
287
287
/**
288
288
* Special type name IDs for searching higher order functions (`->` syntax).
289
289
*/
290
- let typeNameIdOfHof ;
290
+ const typeNameIdOfHof = buildTypeMapIndex ( "->" ) ;
291
291
292
292
/**
293
293
* Add an item to the type Name->ID map, or, if one already exists, use it.
@@ -3159,24 +3159,10 @@ ${item.displayPath}<span class="${type}">${name}</span>\
3159
3159
*/
3160
3160
function buildIndex ( rawSearchIndex ) {
3161
3161
searchIndex = [ ] ;
3162
- typeNameIdMap = new Map ( ) ;
3163
3162
const charA = "A" . charCodeAt ( 0 ) ;
3164
3163
let currentIndex = 0 ;
3165
3164
let id = 0 ;
3166
3165
3167
- // Initialize type map indexes for primitive list types
3168
- // that can be searched using `[]` syntax.
3169
- typeNameIdOfArray = buildTypeMapIndex ( "array" ) ;
3170
- typeNameIdOfSlice = buildTypeMapIndex ( "slice" ) ;
3171
- typeNameIdOfTuple = buildTypeMapIndex ( "tuple" ) ;
3172
- typeNameIdOfUnit = buildTypeMapIndex ( "unit" ) ;
3173
- typeNameIdOfArrayOrSlice = buildTypeMapIndex ( "[]" ) ;
3174
- typeNameIdOfTupleOrUnit = buildTypeMapIndex ( "()" ) ;
3175
- typeNameIdOfFn = buildTypeMapIndex ( "fn" ) ;
3176
- typeNameIdOfFnMut = buildTypeMapIndex ( "fnmut" ) ;
3177
- typeNameIdOfFnOnce = buildTypeMapIndex ( "fnonce" ) ;
3178
- typeNameIdOfHof = buildTypeMapIndex ( "->" ) ;
3179
-
3180
3166
// Function type fingerprints are 128-bit bloom filters that are used to
3181
3167
// estimate the distance between function and query.
3182
3168
// This loop counts the number of items to allocate a fingerprint for.
0 commit comments