Skip to content

Commit 9117773

Browse files
authored
Merge pull request #715 from itchyny/patch-1
Data.Optional: stop evaluation of {alternative} of get_or when it has some value
2 parents b8641ed + 40b7e88 commit 9117773

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)