From b129d1f04f4c74bdf37cdc3a2edf045881339081 Mon Sep 17 00:00:00 2001 From: upstream Date: Fri, 4 Sep 2026 09:18:56 +0200 Subject: [PATCH] Upstream dgilland/pydash state of the touched files before 7ab4f88640 --- src/pydash/arrays.py | 2 +- tests/test_arrays.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pydash/arrays.py b/src/pydash/arrays.py index 573ff26..15fda4b 100644 --- a/src/pydash/arrays.py +++ b/src/pydash/arrays.py @@ -1794,7 +1794,7 @@ def sorted_last_index_of( """ index = sorted_last_index(array, value) - 1 - if 0 <= index < len(array) and array[index] == value: + if index < len(array) and array[index] == value: return index else: return -1 diff --git a/tests/test_arrays.py b/tests/test_arrays.py index 00eb87e..ff4d668 100644 --- a/tests/test_arrays.py +++ b/tests/test_arrays.py @@ -656,10 +656,6 @@ def test_sorted_last_index_by(case, expected): [ ([2, 3, 4, 10, 10], 10, 4), ([10, 10, 4, 2, 3], 11, -1), - # Empty array must return -1, not raise IndexError. - ([], 10, -1), - # Value lower than every element also returns -1 without indexing [-1]. - ([2, 3, 4], 1, -1), ], ) def test_sorted_last_index_of(array, value, expected):