Skip to content

Commit

Permalink
fix: Remove useless list copy
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Dec 6, 2024
1 parent 7f19126 commit 3056863
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ai/backend/client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_lastest_timestamp_for_status(
status_history: list[dict[str, str]],
status: str,
) -> Optional[datetime]:
for item in status_history:
for item in reversed(status_history):
if item["status"] == status:
return dtparse(item["timestamp"])
return None
2 changes: 1 addition & 1 deletion src/ai/backend/manager/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def get_lastest_timestamp_for_status(
If the status is not found, return None.
"""

for item in list(reversed(status_history_log)):
for item in reversed(status_history_log):
if item["status"] == status:
return dtparse(item["timestamp"])
return None
Expand Down

0 comments on commit 3056863

Please sign in to comment.