@@ -245,49 +245,49 @@ function initSearch(rawSearchIndex) {
245245 *
246246 * @type {Map<string, {id: integer, assocOnly: boolean}> }
247247 */
248- let typeNameIdMap ;
248+ const typeNameIdMap = new Map ( ) ;
249249 const ALIASES = new Map ( ) ;
250250
251251 /**
252252 * Special type name IDs for searching by array.
253253 */
254- let typeNameIdOfArray ;
254+ const typeNameIdOfArray = buildTypeMapIndex ( "array" ) ;
255255 /**
256256 * Special type name IDs for searching by slice.
257257 */
258- let typeNameIdOfSlice ;
258+ const typeNameIdOfSlice = buildTypeMapIndex ( "slice" ) ;
259259 /**
260260 * Special type name IDs for searching by both array and slice (`[]` syntax).
261261 */
262- let typeNameIdOfArrayOrSlice ;
262+ const typeNameIdOfArrayOrSlice = buildTypeMapIndex ( "[]" ) ;
263263 /**
264264 * Special type name IDs for searching by tuple.
265265 */
266- let typeNameIdOfTuple ;
266+ const typeNameIdOfTuple = buildTypeMapIndex ( "tuple" ) ;
267267 /**
268268 * Special type name IDs for searching by unit.
269269 */
270- let typeNameIdOfUnit ;
270+ const typeNameIdOfUnit = buildTypeMapIndex ( "unit" ) ;
271271 /**
272272 * Special type name IDs for searching by both tuple and unit (`()` syntax).
273273 */
274- let typeNameIdOfTupleOrUnit ;
274+ const typeNameIdOfTupleOrUnit = buildTypeMapIndex ( "()" ) ;
275275 /**
276276 * Special type name IDs for searching `fn`.
277277 */
278- let typeNameIdOfFn ;
278+ const typeNameIdOfFn = buildTypeMapIndex ( "fn" ) ;
279279 /**
280280 * Special type name IDs for searching `fnmut`.
281281 */
282- let typeNameIdOfFnMut ;
282+ const typeNameIdOfFnMut = buildTypeMapIndex ( "fnmut" ) ;
283283 /**
284284 * Special type name IDs for searching `fnonce`.
285285 */
286- let typeNameIdOfFnOnce ;
286+ const typeNameIdOfFnOnce = buildTypeMapIndex ( "fnonce" ) ;
287287 /**
288288 * Special type name IDs for searching higher order functions (`->` syntax).
289289 */
290- let typeNameIdOfHof ;
290+ const typeNameIdOfHof = buildTypeMapIndex ( "->" ) ;
291291
292292 /**
293293 * 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>\
30903090 */
30913091 function buildIndex ( rawSearchIndex ) {
30923092 searchIndex = [ ] ;
3093- typeNameIdMap = new Map ( ) ;
30943093 const charA = "A" . charCodeAt ( 0 ) ;
30953094 let currentIndex = 0 ;
30963095 let id = 0 ;
30973096
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-
31113097 // Function type fingerprints are 128-bit bloom filters that are used to
31123098 // estimate the distance between function and query.
31133099 // This loop counts the number of items to allocate a fingerprint for.
0 commit comments