From 2b7e219efe8e2d54d6cb9fddb17969af2d8058b1 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 9 Dec 2018 03:44:37 +0900 Subject: [PATCH] Eliminate if-statement (#3562) --- src/client/app/common/views/components/mfm.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/client/app/common/views/components/mfm.ts b/src/client/app/common/views/components/mfm.ts index 7b0f8bd17..ecb22b6bc 100644 --- a/src/client/app/common/views/components/mfm.ts +++ b/src/client/app/common/views/components/mfm.ts @@ -67,14 +67,9 @@ export default Vue.component('misskey-flavored-markdown', { render(createElement) { if (this.text == null || this.text == '') return; - let ast: Node[]; - - if (this.ast == null) { - // Parse text to ast - ast = parse(this.text, this.plainText); - } else { - ast = this.ast as Node[]; - } + const ast = this.ast == null ? + parse(this.text, this.plainText) : // Parse text to ast + this.ast as Node[]; let bigCount = 0; let motionCount = 0;