From 0c44174564005e07ddf9667abbb4a139ad39b4e2 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 9 Aug 2019 23:46:25 +0800 Subject: [PATCH] :art: Remove redundant slice assignment --- extension/table.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/extension/table.go b/extension/table.go index a5bfce6..a11f89e 100644 --- a/extension/table.go +++ b/extension/table.go @@ -116,24 +116,12 @@ func (b *tableParagraphTransformer) parseDelimiter(segment text.Segment, reader var alignments []ast.Alignment for _, col := range cols { if tableDelimLeft.Match(col) { - if alignments == nil { - alignments = []ast.Alignment{} - } alignments = append(alignments, ast.AlignLeft) } else if tableDelimRight.Match(col) { - if alignments == nil { - alignments = []ast.Alignment{} - } alignments = append(alignments, ast.AlignRight) } else if tableDelimCenter.Match(col) { - if alignments == nil { - alignments = []ast.Alignment{} - } alignments = append(alignments, ast.AlignCenter) } else if tableDelimNone.Match(col) { - if alignments == nil { - alignments = []ast.Alignment{} - } alignments = append(alignments, ast.AlignNone) } else { return nil