Page MenuHomeSoftware Heritage

D5066.id.diff
No OneTemporary

D5066.id.diff

diff --git a/swh/scheduler/journal_client.py b/swh/scheduler/journal_client.py
--- a/swh/scheduler/journal_client.py
+++ b/swh/scheduler/journal_client.py
@@ -19,18 +19,11 @@
At least one date must be not None.
"""
- datesok: Tuple[datetime, ...] = tuple(d for d in dates if d is not None)
- if not datesok:
+ filtered_dates = [d for d in dates if d is not None]
+ if not filtered_dates:
raise ValueError("At least one date should be a valid datetime")
- maxdate = datesok[0]
- if len(datesok) == 1:
- return maxdate
-
- for d in datesok[1:]:
- maxdate = max(d, maxdate)
-
- return maxdate
+ return max(filtered_dates)
def process_journal_objects(

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 11:19 PM (19 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219128

Event Timeline