util: micro-optimization of existence check for vcscommand plugin

This commit is contained in:
Christian Brabandt 2019-08-20 22:30:20 +02:00
parent 5df9e23f14
commit 57fb980df7
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -143,7 +143,10 @@ function! airline#util#has_lawrencium()
endfunction
function! airline#util#has_vcscommand()
return get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')
if !exists("s:has_vcscommand")
let s:has_vcscommand = exists('*VCSCommandGetStatusLine')
endif
return get(g:, 'airline#extensions#branch#use_vcscommand', 0) && s:has_vcscommand
endfunction
function! airline#util#has_custom_scm()