Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7085417
D5066.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
718 B
Subscribers
None
D5066.id.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 11:19 PM (21 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219128
Attached To
D5066: Simplify max_date()
Event Timeline
Log In to Comment