Skip to content

Commit a622a0b

Browse files
committed
Prefer using values() to items()
Use values() instead of items() where dictionary keys are not used in iteration.
1 parent f7ccf00 commit a622a0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

autoload/lsp/internal/diagnostics/state.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ endfunction
108108
function! s:on_exit(response) abort
109109
let l:server = a:response['params']['server']
110110
let l:notify = 0
111-
for [l:key, l:value] in items(s:diagnostics_state)
111+
for l:value in values(s:diagnostics_state)
112112
if has_key(l:value, l:server)
113113
let l:notify = 1
114114
call remove(l:value, l:server)
@@ -162,7 +162,7 @@ function! lsp#internal#diagnostics#state#_get_diagnostics_count_for_buffer(bufnr
162162
\ }
163163
if lsp#internal#diagnostics#state#_is_enabled_for_buffer(a:bufnr)
164164
let l:uri = lsp#utils#get_buffer_uri(a:bufnr)
165-
for [l:_, l:response] in items(lsp#internal#diagnostics#state#_get_all_diagnostics_grouped_by_server_for_uri(l:uri))
165+
for l:response in values(lsp#internal#diagnostics#state#_get_all_diagnostics_grouped_by_server_for_uri(l:uri))
166166
for l:diagnostic in lsp#utils#iteratable(l:response['params']['diagnostics'])
167167
let l:key = get(s:diagnostic_kinds, get(l:diagnostic, 'severity', 1) , 'error')
168168
let l:counts[l:key] += 1

0 commit comments

Comments
 (0)