Skip to content

Commit 40b7e88

Browse files
authored
Data.Optional: stop evaluation of {alternative} of get_or when it has some value
1 parent b8641ed commit 40b7e88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/vital/__vital__/Data/Optional.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function! s:get_unsafe(o) abort
7474
endfunction
7575

7676
function! s:get_or(o, alt) abort
77-
return get(a:o, s:SOME_KEY, a:alt())
77+
return has_key(a:o, s:SOME_KEY) ? a:o[s:SOME_KEY] : a:alt()
7878
endfunction
7979

8080
function! s:has(o, type) abort

0 commit comments

Comments
 (0)