From 20f6e4097c8692ebf11af9a60eaf45727111f4a6 Mon Sep 17 00:00:00 2001 From: Kien N Date: Sat, 15 Sep 2012 13:32:38 +0700 Subject: [PATCH] Simplify some conditional expressions --- autoload/ctrlp.vim | 8 ++++---- autoload/ctrlp/dir.vim | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index d8d2d3c..df61b5f 100644 --- a/autoload/ctrlp.vim +++ b/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) diff --git a/autoload/ctrlp/dir.vim b/autoload/ctrlp/dir.vim index e9a6c1c..03be1a5 100644 --- a/autoload/ctrlp/dir.vim +++ b/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()