Simplify some conditional expressions

This commit is contained in:
Kien N 2012-09-15 13:32:38 +07:00
parent 985c3b3541
commit 20f6e4097c
2 changed files with 5 additions and 5 deletions

View File

@ -384,7 +384,7 @@ fu! s:lsCmd()
if s:findroot(s:dyncwd, cmd[0], 0, 1) == [] if s:findroot(s:dyncwd, cmd[0], 0, 1) == []
retu len(cmd) == 3 ? cmd[2] : '' retu len(cmd) == 3 ? cmd[2] : ''
en en
let s:vcscmd = s:lash == '\' ? 1 : 0 let s:vcscmd = s:lash == '\'
retu cmd[1] retu cmd[1]
elsei type(cmd) == 4 && ( has_key(cmd, 'types') || has_key(cmd, 'fallback') ) elsei type(cmd) == 4 && ( has_key(cmd, 'types') || has_key(cmd, 'fallback') )
let fndroot = [] let fndroot = []
@ -401,7 +401,7 @@ fu! s:lsCmd()
for pair in cmdtypes for pair in cmdtypes
if pair[0] == fndroot[0] | brea | en if pair[0] == fndroot[0] | brea | en
endfo endfo
let s:vcscmd = s:lash == '\' ? 1 : 0 let s:vcscmd = s:lash == '\'
retu pair[1] retu pair[1]
en en
endf endf
@ -1114,7 +1114,7 @@ fu! s:OpenMulti(...)
if conds[nopt] if conds[nopt]
if !buflisted(bufnr) | cal s:openfile('bad', va, '', 0) | en if !buflisted(bufnr) | cal s:openfile('bad', va, '', 0) | en
el el
cal s:openfile(cmd, useb ? bufnr : va, tail, ic == 1 ? 1 : 0) cal s:openfile(cmd, useb ? bufnr : va, tail, ic == 1)
if jf | if ic == 1 if jf | if ic == 1
let crpos = [tabpagenr(), winnr()] let crpos = [tabpagenr(), winnr()]
el el
@ -1793,7 +1793,7 @@ fu! ctrlp#j2l(nr)
endf endf
fu! s:maxf(len) fu! s:maxf(len)
retu s:maxfiles && a:len > s:maxfiles ? 1 : 0 retu s:maxfiles && a:len > s:maxfiles
endf endf
fu! s:regexfilter(str) fu! s:regexfilter(str)

View File

@ -37,7 +37,7 @@ fu! s:globdirs(dirs, depth)
endf endf
fu! s:max(len, max) fu! s:max(len, max)
retu a:max && a:len > a:max ? 1 : 0 retu a:max && a:len > a:max
endf endf
fu! s:nocache() fu! s:nocache()