1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

minor optimization by reordering expressions

This commit is contained in:
Kelly Brazil
2022-03-24 12:37:46 -07:00
parent 17df5bfcfc
commit 978caf4522

View File

@ -176,6 +176,18 @@ def _is_separator(line: str) -> bool:
# This function is cacheable since tables have identical separators
strip_line = line.strip()
if any((
strip_line.startswith('|-') and strip_line.endswith('-|'),
strip_line.startswith('━━') and strip_line.endswith('━━'),
strip_line.startswith('──') and strip_line.endswith('──'),
strip_line.startswith('┄┄') and strip_line.endswith('┄┄'),
strip_line.startswith('┅┅') and strip_line.endswith('┅┅'),
strip_line.startswith('┈┈') and strip_line.endswith('┈┈'),
strip_line.startswith('┉┉') and strip_line.endswith('┉┉'),
strip_line.startswith('══') and strip_line.endswith('══'),
strip_line.startswith('--') and strip_line.endswith('--'),
strip_line.startswith('==') and strip_line.endswith('=='),
strip_line.startswith('+=') and strip_line.endswith('=+'),
strip_line.startswith('+-') and strip_line.endswith('-+'),
strip_line.startswith('') and strip_line.endswith(''),
strip_line.startswith('') and strip_line.endswith(''),
strip_line.startswith('') and strip_line.endswith(''),
@ -202,19 +214,7 @@ def _is_separator(line: str) -> bool:
strip_line.startswith('') and strip_line.endswith(''),
strip_line.startswith('') and strip_line.endswith(''),
strip_line.startswith('') and strip_line.endswith(''),
strip_line.startswith('') and strip_line.endswith(''),
strip_line.startswith('━━') and strip_line.endswith('━━'),
strip_line.startswith('──') and strip_line.endswith('──'),
strip_line.startswith('┄┄') and strip_line.endswith('┄┄'),
strip_line.startswith('┅┅') and strip_line.endswith('┅┅'),
strip_line.startswith('┈┈') and strip_line.endswith('┈┈'),
strip_line.startswith('┉┉') and strip_line.endswith('┉┉'),
strip_line.startswith('══') and strip_line.endswith('══'),
strip_line.startswith('+=') and strip_line.endswith('=+'),
strip_line.startswith('+-') and strip_line.endswith('-+'),
strip_line.startswith('--') and strip_line.endswith('--'),
strip_line.startswith('==') and strip_line.endswith('=='),
strip_line.startswith('|-') and strip_line.endswith('-|')
strip_line.startswith('') and strip_line.endswith('')
)):
return True
return False