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 {{{
|
# 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)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user