Optimise ale#Set slightly

This commit is contained in:
w0rp 2018-07-05 00:40:15 +01:00
parent 13a8f9c061
commit 14025c725f
No known key found for this signature in database
GPG Key ID: 0FC1ECAA8C81CD83

View File

@ -207,10 +207,10 @@ endfunction
" Every variable name will be prefixed with 'ale_'.
function! ale#Set(variable_name, default) abort
let l:full_name = 'ale_' . a:variable_name
let l:value = get(g:, l:full_name, a:default)
let g:[l:full_name] = l:value
return l:value
if !has_key(g:, l:full_name)
let g:[l:full_name] = a:default
endif
endfunction
" Escape a string suitably for each platform.