util: micro-optimization of existence check for fugitive

This commit is contained in:
Christian Brabandt 2019-08-20 22:23:19 +02:00
parent 51e74f1d1f
commit 0370a3b89b
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 4 additions and 1 deletions

View File

@ -129,7 +129,10 @@ function! airline#util#ignore_buf(name)
endfunction endfunction
function! airline#util#has_fugitive() function! airline#util#has_fugitive()
return exists('*fugitive#head') || exists('*FugitiveHead') if !exists("s:has_fugitive")
let s:has_fugitive = exists('*fugitive#head') || exists('*FugitiveHead')
endif
return s:has_fugitive
endfunction endfunction
function! airline#util#has_lawrencium() function! airline#util#has_lawrencium()