mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Micro optimization
This commit is contained in:
parent
21f5455c05
commit
ee214d6df5
@ -507,13 +507,13 @@ def select_nth_last_of_type(cache, function, elem):
|
||||
# Pseudo elements {{{
|
||||
|
||||
def select_pseudo(cache, pseudo):
|
||||
try:
|
||||
func = cache.dispatch_map[pseudo.ident.replace('-', '_')]
|
||||
except KeyError:
|
||||
if pseudo.ident == 'root':
|
||||
yield cache.root
|
||||
return
|
||||
|
||||
try:
|
||||
func = cache.dispatch_map[pseudo.ident.replace('-', '_')]
|
||||
except KeyError:
|
||||
raise ExpressionError(
|
||||
"The pseudo-class :%s is not supported" % pseudo.ident)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user