chore(developer): drops redundant buildFromWordList return

This commit is contained in:
Joshua A. Horton 2024-08-06 08:45:19 +07:00
parent c16ae2724a
commit 8504a96a4e

View file

@ -304,13 +304,12 @@ namespace Trie {
* Populates the trie with the contents of an entire wordlist.
* @param words a list of word and count pairs.
*/
function buildFromWordList(trie: Trie, words: WordList): Trie {
function buildFromWordList(trie: Trie, words: WordList): void {
for (let [wordform, weight] of Object.entries(words)) {
let key = trie.toKey(wordform);
const key = trie.toKey(wordform);
addUnsorted(trie.root, { key, weight, content: wordform }, 0);
}
sortTrie(trie.root);
return trie;
}
/**