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:
@ -176,6 +176,18 @@ def _is_separator(line: str) -> bool:
|
|||||||
# This function is cacheable since tables have identical separators
|
# This function is cacheable since tables have identical separators
|
||||||
strip_line = line.strip()
|
strip_line = line.strip()
|
||||||
if any((
|
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('╡'),
|
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('-+'),
|
|
||||||
strip_line.startswith('--') and strip_line.endswith('--'),
|
|
||||||
strip_line.startswith('==') and strip_line.endswith('=='),
|
|
||||||
strip_line.startswith('|-') and strip_line.endswith('-|')
|
|
||||||
)):
|
)):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
Reference in New Issue
Block a user