Skip to content

Commit 15271e1

Browse files
committed
cleanup
1 parent 48fc24b commit 15271e1

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/blurb/blurb.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,8 @@ def _find_smart_matches(section):
940940
section_words = re.split(r'\s+', sanitized)
941941
# ' ' and '/' are the separators used by known sections
942942
section_pattern = r'[ /]'.join(map(re.escape, section_words))
943-
944943
section_pattern = re.compile(section_pattern, re.I)
944+
945945
for section_name in sections:
946946
# try to use the input as the pattern to match against known names
947947
if section_pattern.match(section_name):
@@ -958,14 +958,12 @@ def _find_smart_matches(section):
958958
# try to use the input as the prefix of a flattened section name
959959
normalized_prefix = ''.join(section_words).lower()
960960
for section_name, normalized in _section_names_lower_nosep.items():
961-
if (
962-
len(normalized_prefix) <= len(normalized) and
963-
normalized.startswith(normalized_prefix)
964-
):
961+
if normalized.startswith(normalized_prefix):
965962
matches.append(section_name)
966963

967964
return matches
968965

966+
969967
def _extract_section_name(section):
970968
if section is None:
971969
return None

0 commit comments

Comments
 (0)