optimize funcrefs for 7.4
This commit is contained in:
parent
e7c5bbb671
commit
840f78607e
|
@ -12,19 +12,33 @@ else
|
||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! airline#util#exec_funcrefs(list, break_early)
|
if v:version >= 704
|
||||||
" for 7.2; we cannot iterate list, hence why we use range()
|
function! airline#util#exec_funcrefs(list, break_early)
|
||||||
" for 7.3-[97, 328]; we cannot reuse the variable, hence the {}
|
for Fn in a:list
|
||||||
for i in range(0, len(a:list) - 1)
|
if a:break_early
|
||||||
let Fn{i} = a:list[i]
|
if Fn()
|
||||||
if a:break_early
|
return 1
|
||||||
if Fn{i}()
|
endif
|
||||||
return 1
|
else
|
||||||
|
call Fn()
|
||||||
endif
|
endif
|
||||||
else
|
endfor
|
||||||
call Fn{i}()
|
endfunction
|
||||||
endif
|
else
|
||||||
endfor
|
function! airline#util#exec_funcrefs(list, break_early)
|
||||||
return 0
|
" for 7.2; we cannot iterate the list, hence why we use range()
|
||||||
endfunction
|
" for 7.3-[97, 328]; we cannot reuse the variable, hence the {}
|
||||||
|
for i in range(0, len(a:list) - 1)
|
||||||
|
let Fn{i} = a:list[i]
|
||||||
|
if a:break_early
|
||||||
|
if Fn{i}()
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
call Fn{i}()
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue