diff --git a/stdlib/src/collections/list.mojo b/stdlib/src/collections/list.mojo index 232e31f305..777a42173b 100644 --- a/stdlib/src/collections/list.mojo +++ b/stdlib/src/collections/list.mojo @@ -738,8 +738,8 @@ struct List[T: CollectionElement, hint_trivial_type: Bool = False]( if stop_normalized < 0: stop_normalized += len(self) - start_normalized = max(start_normalized, min(0, len(self))) - stop_normalized = max(stop_normalized, min(0, len(self))) + start_normalized = max(0, min(start_normalized, len(self))) + stop_normalized = max(0, min(stop_normalized, len(self))) for i in range(start_normalized, stop_normalized): if self[i] == value: