Skip to content

Commit e534f47

Browse files
committed
Add descriptive comment for NameTrie
1 parent 1d13399 commit e534f47

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/librustdoc/html/static/js/search.js

+19
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,25 @@ class RoaringBitmapBits {
11071107
}
11081108

11091109
/**
1110+
* A prefix tree, used for name-based search.
1111+
*
1112+
* This data structure is used to drive prefix matches,
1113+
* such as matching the query "link" to `LinkedList`,
1114+
* and Lev-distance matches, such as matching the
1115+
* query "hahsmap" to `HashMap`. Substring matches,
1116+
* such as "list" to `LinkedList`, are done with a
1117+
* tailTable that deep-links into this trie.
1118+
*
1119+
* children
1120+
* : A [sparse array] of subtrees. The array index
1121+
* is a charCode.
1122+
*
1123+
* [sparse array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/
1124+
* Indexed_collections#sparse_arrays
1125+
*
1126+
* matches
1127+
* : A list of search index IDs for this node.
1128+
*
11101129
* @typedef {{
11111130
* children: [NameTrie],
11121131
* matches: [number],

0 commit comments

Comments
 (0)