Skip to content

Commit

Permalink
Add descriptive comment for NameTrie
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Nov 13, 2024
1 parent 1d13399 commit e534f47
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/librustdoc/html/static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,25 @@ class RoaringBitmapBits {
}

/**
* A prefix tree, used for name-based search.
*
* This data structure is used to drive prefix matches,
* such as matching the query "link" to `LinkedList`,
* and Lev-distance matches, such as matching the
* query "hahsmap" to `HashMap`. Substring matches,
* such as "list" to `LinkedList`, are done with a
* tailTable that deep-links into this trie.
*
* children
* : A [sparse array] of subtrees. The array index
* is a charCode.
*
* [sparse array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/
* Indexed_collections#sparse_arrays
*
* matches
* : A list of search index IDs for this node.
*
* @typedef {{
* children: [NameTrie],
* matches: [number],
Expand Down

0 comments on commit e534f47

Please sign in to comment.