Skip to content

Commit 1f4c50a

Browse files
committed
Revert performance optimization
Measured wrongly. Original code or using a set should be faster.
1 parent f917259 commit 1f4c50a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/graphql/language/block_string.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import re
2-
31
__all__ = [
42
"dedent_block_string_value",
53
"print_block_string",
@@ -38,12 +36,9 @@ def dedent_block_string_value(raw_string: str) -> str:
3836
return "\n".join(lines[start_line:end_line])
3937

4038

41-
_re_blank = re.compile("[ \\t]*")
42-
43-
4439
def is_blank(s: str) -> bool:
4540
"""Check whether string contains only space or tab characters."""
46-
return _re_blank.fullmatch(s) is not None
41+
return all(c == " " or c == "\t" for c in s)
4742

4843

4944
def get_block_string_indentation(value: str) -> int:

0 commit comments

Comments
 (0)