From f6a2cfbf1358e2771b0d071973d1617ffb0c9b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Barroso=20Galindo?= Date: Wed, 31 Jul 2024 16:33:17 +0200 Subject: [PATCH] Simplifying --- .github/download_distribution.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/download_distribution.py b/.github/download_distribution.py index dab5e25c4..37b727a59 100755 --- a/.github/download_distribution.py +++ b/.github/download_distribution.py @@ -573,7 +573,7 @@ def is_rbf(path: str) -> bool: def get_latest_release(folder: str, bin: str) -> str: files = [without_folder(folder, f) for f in list_files(folder, recursive=False)] - releases = sorted([f for f in files if bin in f and remove_date(f) != f]) + releases = sorted([f for f in files if bin.lower() in f.lower() and remove_date(f).lower() != f.lower()]) return releases[-1] def uniq_files_with_stripped_date(folder: str) -> List[str]: @@ -584,16 +584,10 @@ def uniq_files_with_stripped_date(folder: str) -> List[str]: no_date = remove_date(f) lower_no_date = no_date.lower() - if lower_no_date == f.lower(): + if lower_no_date == f.lower() or lower_no_date in seen: continue - if lower_no_date in seen: - if no_date not in result: - result = [r for r in result if r.lower() != lower_no_date] - result.append(no_date) - else: - seen.add(lower_no_date) - result.append(no_date) + seen.add(lower_no_date) result.append(no_date) return result