summaryrefslogtreecommitdiff
path: root/src/client/app/common
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2018-12-09 03:44:37 +0900
committerGitHub <noreply@github.com>2018-12-09 03:44:37 +0900
commit15b11e59f4575f3f791c7b12968545856bb319ce (patch)
treefa9d2343ac9c455615538bc9dfd51cfc6645ed0f /src/client/app/common
parentEliminate if-statement (#3561) (diff)
downloadmisskey-15b11e59f4575f3f791c7b12968545856bb319ce.tar.gz
misskey-15b11e59f4575f3f791c7b12968545856bb319ce.tar.bz2
misskey-15b11e59f4575f3f791c7b12968545856bb319ce.zip
Eliminate if-statement (#3562)
Diffstat (limited to 'src/client/app/common')
-rw-r--r--src/client/app/common/views/components/mfm.ts11
1 files 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 7b0f8bd170..ecb22b6bc4 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;