Remove redundant layer of branching in get_cell_aligns_fast

This commit is contained in:
Henry Qin 2019-04-10 11:06:05 -07:00
parent 63985a52e8
commit 048f2eb34a
1 changed files with 6 additions and 10 deletions

View File

@ -313,16 +313,12 @@ function! s:get_cell_aligns_fast(rows)
if !empty(cs)
let lstart = len(cs[1])
let lend = len(cs[2])
if lstart > 0 || lend > 0
if lstart > 0 && lend > 0
let aligns[idx] = 'center'
else
if lend > 0
let aligns[idx] = 'left'
elseif lstart > 0
let aligns[idx] = 'right'
endif
endif
if lstart > 0 && lend > 0
let aligns[idx] = 'center'
elseif lend > 0
let aligns[idx] = 'left'
elseif lstart > 0
let aligns[idx] = 'right'
endif
endif
endif