@@ -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.
@@ -3090,24 +3090,10 @@ ${item.displayPath}<span class="${type}">${name}</span>\
3090
3090
*/
3091
3091
function buildIndex ( rawSearchIndex ) {
3092
3092
searchIndex = [ ] ;
3093
- typeNameIdMap = new Map ( ) ;
3094
3093
const charA = "A" . charCodeAt ( 0 ) ;
3095
3094
let currentIndex = 0 ;
3096
3095
let id = 0 ;
3097
3096
3098
- // Initialize type map indexes for primitive list types
3099
- // that can be searched using `[]` syntax.
3100
- typeNameIdOfArray = buildTypeMapIndex ( "array" ) ;
3101
- typeNameIdOfSlice = buildTypeMapIndex ( "slice" ) ;
3102
- typeNameIdOfTuple = buildTypeMapIndex ( "tuple" ) ;
3103
- typeNameIdOfUnit = buildTypeMapIndex ( "unit" ) ;
3104
- typeNameIdOfArrayOrSlice = buildTypeMapIndex ( "[]" ) ;
3105
- typeNameIdOfTupleOrUnit = buildTypeMapIndex ( "()" ) ;
3106
- typeNameIdOfFn = buildTypeMapIndex ( "fn" ) ;
3107
- typeNameIdOfFnMut = buildTypeMapIndex ( "fnmut" ) ;
3108
- typeNameIdOfFnOnce = buildTypeMapIndex ( "fnonce" ) ;
3109
- typeNameIdOfHof = buildTypeMapIndex ( "->" ) ;
3110
-
3111
3097
// Function type fingerprints are 128-bit bloom filters that are used to
3112
3098
// estimate the distance between function and query.
3113
3099
// This loop counts the number of items to allocate a fingerprint for.
0 commit comments