summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-05 00:40:15 +0100
committerw0rp <devw0rp@gmail.com>2018-07-05 00:40:15 +0100
commit14025c725f4d94c6661071cfa85fc5c996e8b390 (patch)
tree8f5827815060f79fcc457364ccdcc26604f6c16d /autoload
parent13a8f9c06110c065086ce7e569bab68d0e222398 (diff)
downloadale-14025c725f4d94c6661071cfa85fc5c996e8b390.zip
Optimise ale#Set slightly
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale.vim6
1 files changed, 3 insertions, 3 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim
index 8aa8bbd9..f61418f6 100644
--- a/autoload/ale.vim
+++ b/autoload/ale.vim
@@ -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.