Upstream dgilland/pydash state of the touched files before 7ab4f88640
This commit is contained in:
1 parent
9194f6d3ad
commit
b129d1f04f
2 files changed
+1
-5
No files matched your search
@@ -1794,7 +1794,7 @@ def sorted_last_index_of(
|
|||||||
"""
|
"""
|
||||||
index = sorted_last_index(array, value) - 1
|
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
|
return index
|
||||||
else:
|
else:
|
||||||
return -1
|
return -1
|
||||||
|
|||||||
@@ -656,10 +656,6 @@ def test_sorted_last_index_by(case, expected):
|
|||||||
[
|
[
|
||||||
([2, 3, 4, 10, 10], 10, 4),
|
([2, 3, 4, 10, 10], 10, 4),
|
||||||
([10, 10, 4, 2, 3], 11, -1),
|
([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):
|
def test_sorted_last_index_of(array, value, expected):
|
||||||
|
|||||||
Reference in new issue
Block a user