Registry: minor optimisation.
This commit is contained in:
parent
871a537e48
commit
1de31fa5e8
@ -19,7 +19,7 @@ if has('reltime')
|
||||
lockvar! g:_SYNTASTIC_START
|
||||
endif
|
||||
|
||||
let g:_SYNTASTIC_VERSION = '3.7.0-92'
|
||||
let g:_SYNTASTIC_VERSION = '3.7.0-93'
|
||||
lockvar g:_SYNTASTIC_VERSION
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
@ -164,7 +164,7 @@ function! g:SyntasticRegistry.CreateAndRegisterChecker(args) abort " {{{2
|
||||
|
||||
if has_key(a:args, 'redirect')
|
||||
let [ft, name] = split(a:args['redirect'], '/')
|
||||
call registry._loadCheckersFor(ft, 1)
|
||||
call registry._loadCheckersFor(ft, ft ==# a:args['filetype'])
|
||||
|
||||
let clone = get(registry._checkerMap[ft], name, {})
|
||||
if empty(clone)
|
||||
@ -321,10 +321,10 @@ function! g:SyntasticRegistry._filterCheckersByName(checkers_map, list) abort "
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticRegistry._loadCheckersFor(filetype, ...) abort " {{{2
|
||||
" XXX: a:0 > 0 means we're being called recursively from
|
||||
" XXX: a:1 == 1 means we're being called recursively from
|
||||
" CreateAndRegisterChecker(), by a checker redirecting to
|
||||
" the same filetype
|
||||
if has_key(self._checkerMap, a:filetype) && !a:0
|
||||
if has_key(self._checkerMap, a:filetype) && (!a:0 || !a:1)
|
||||
return
|
||||
endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user