Performance improvement

This commit is contained in:
Kovid Goyal 2014-05-21 16:52:50 +05:30
parent f38af40146
commit 1a71d61e8b

View File

@ -56,7 +56,7 @@ def tokenize_flat(css_source, ignore_comments=True,
codepoint = min(ord(char), 160)
for _index, type_, regexp in tokens_dispatch[codepoint]:
match = regexp(css_source, pos)
if match:
if match is not None:
# First match is the longest. See comments on TOKENS above.
css_value = match.group()
break