Micro optimization

This commit is contained in:
Kovid Goyal 2015-02-20 17:38:59 +05:30
parent 21f5455c05
commit ee214d6df5

View File

@ -507,13 +507,13 @@ def select_nth_last_of_type(cache, function, elem):
# Pseudo elements {{{ # Pseudo elements {{{
def select_pseudo(cache, pseudo): def select_pseudo(cache, pseudo):
try:
func = cache.dispatch_map[pseudo.ident.replace('-', '_')]
except KeyError:
if pseudo.ident == 'root': if pseudo.ident == 'root':
yield cache.root yield cache.root
return return
try:
func = cache.dispatch_map[pseudo.ident.replace('-', '_')]
except KeyError:
raise ExpressionError( raise ExpressionError(
"The pseudo-class :%s is not supported" % pseudo.ident) "The pseudo-class :%s is not supported" % pseudo.ident)