Registry: minor optimisation.

This commit is contained in:
LCD 47 2016-02-29 13:06:56 +02:00
parent 871a537e48
commit 1de31fa5e8
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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