Permalink
Browse files

Simplify some conditional expressions

  • Loading branch information...
1 parent 985c3b3 commit 20f6e4097c8692ebf11af9a60eaf45727111f4a6 @kien committed Sep 15, 2012
Showing with 5 additions and 5 deletions.
  1. +4 −4 autoload/ctrlp.vim
  2. +1 −1 autoload/ctrlp/dir.vim
View
8 autoload/ctrlp.vim
@@ -384,7 +384,7 @@ fu! s:lsCmd()
if s:findroot(s:dyncwd, cmd[0], 0, 1) == []
retu len(cmd) == 3 ? cmd[2] : ''
en
- let s:vcscmd = s:lash == '\' ? 1 : 0
+ let s:vcscmd = s:lash == '\'
retu cmd[1]
elsei type(cmd) == 4 && ( has_key(cmd, 'types') || has_key(cmd, 'fallback') )
let fndroot = []
@@ -401,7 +401,7 @@ fu! s:lsCmd()
for pair in cmdtypes
if pair[0] == fndroot[0] | brea | en
endfo
- let s:vcscmd = s:lash == '\' ? 1 : 0
+ let s:vcscmd = s:lash == '\'
retu pair[1]
en
endf
@@ -1114,7 +1114,7 @@ fu! s:OpenMulti(...)
if conds[nopt]
if !buflisted(bufnr) | cal s:openfile('bad', va, '', 0) | en
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
let crpos = [tabpagenr(), winnr()]
el
@@ -1793,7 +1793,7 @@ fu! ctrlp#j2l(nr)
endf
fu! s:maxf(len)
- retu s:maxfiles && a:len > s:maxfiles ? 1 : 0
+ retu s:maxfiles && a:len > s:maxfiles
endf
fu! s:regexfilter(str)
View
2 autoload/ctrlp/dir.vim
@@ -37,7 +37,7 @@ fu! s:globdirs(dirs, depth)
endf
fu! s:max(len, max)
- retu a:max && a:len > a:max ? 1 : 0
+ retu a:max && a:len > a:max
endf
fu! s:nocache()

0 comments on commit 20f6e40

Please sign in to comment.