mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Performance improvement
This commit is contained in:
parent
f38af40146
commit
1a71d61e8b
@ -56,7 +56,7 @@ def tokenize_flat(css_source, ignore_comments=True,
|
|||||||
codepoint = min(ord(char), 160)
|
codepoint = min(ord(char), 160)
|
||||||
for _index, type_, regexp in tokens_dispatch[codepoint]:
|
for _index, type_, regexp in tokens_dispatch[codepoint]:
|
||||||
match = regexp(css_source, pos)
|
match = regexp(css_source, pos)
|
||||||
if match:
|
if match is not None:
|
||||||
# First match is the longest. See comments on TOKENS above.
|
# First match is the longest. See comments on TOKENS above.
|
||||||
css_value = match.group()
|
css_value = match.group()
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user