From 619df42aedaa8da97d0a16d539b7211349143a0a Mon Sep 17 00:00:00 2001 From: siikamiika Date: Tue, 14 Apr 2020 21:25:02 +0300 Subject: simplify to enable constant usage --- ext/bg/js/backend.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 960c65bf..f8b0fc96 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -349,11 +349,10 @@ class Backend { for (const [mecabName, parsedLines] of Object.entries(rawResults)) { const result = []; for (const parsedLine of parsedLines) { - for (let {expression, reading, source} of parsedLine) { + for (const {expression, reading, source} of parsedLine) { const term = []; - if (expression === '') { expression = source; } for (const {text: text2, furigana} of jp.distributeFuriganaInflected( - expression, + expression.length > 0 ? expression : source, jp.convertKatakanaToHiragana(reading), source )) { -- cgit v1.2.3