summaryrefslogtreecommitdiff
path: root/ext/js/display/display-generator.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/display/display-generator.js')
-rw-r--r--ext/js/display/display-generator.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js
index 91dc0862..1d824507 100644
--- a/ext/js/display/display-generator.js
+++ b/ext/js/display/display-generator.js
@@ -724,15 +724,15 @@ class DisplayGenerator {
_getPitchAccentCategories(pitches) {
if (pitches.length === 0) { return null; }
- const categories = [];
+ const categories = new Set();
for (const {reading, pitches: pitches2} of pitches) {
for (const {position} of pitches2) {
const category = this._japaneseUtil.getPitchCategory(reading, position, false);
if (category !== null) {
- categories.push(category);
+ categories.add(category);
}
}
}
- return categories.length > 0 ? categories.join(' ') : null;
+ return categories.size > 0 ? [...categories].join(' ') : null;
}
}