aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-15 17:15:24 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-22 14:43:06 -0500
commit69b5007842e08a8fda4016712a5046f81799e638 (patch)
tree85c6407b3be78e36898a38e3f6f1308b9f8f8e9b /ext/bg/js/translator.js
parent45c685d00a7b98c33118dc50efd780e5be483936 (diff)
Reduce number of redundant Map.get calls in dictTermsMergeByGloss
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 9a69e30e..6cf07d93 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -127,7 +127,8 @@ class Translator {
const expressions = [];
for (const [expression, readingMap] of result.expressions.entries()) {
- for (const [reading, termTags] of readingMap.entries()) {
+ for (const [reading, termTagsMap] of readingMap.entries()) {
+ const termTags = [...termTagsMap.values()];
const score = termTags.map((tag) => tag.score).reduce((p, v) => p + v, 0);
expressions.push(Translator.createExpression(expression, reading, dictTagsSort(termTags), Translator.scoreToTermFrequency(score)));
}