5 Commits
Author SHA1 Message Date
dualfroz 99361f9458 Describe this repository 2026-10-22 21:03:21 +02:00
dualfroz e683ca33c6 fix(arrays): stop fill from growing the array on reversed spans
fill rebuilt the array as array[:start] + fill + array[end:]. When start
came after end those two slices overlapped, duplicating the shared
elements and growing the array while writing no value. Normalize start and
end into [0, length] and fill in place with an index loop so an empty span
is a no-op and the length stays fixed.
2026-09-04 09:18:56 +02:00
dualfroz 442a17b572 fix(arrays): stop fill from growing the array on reversed spans
fill rebuilt the array as array[:start] + fill + array[end:]. When start
came after end those two slices overlapped, duplicating the shared
elements and growing the array while writing no value. Normalize start and
end into [0, length] and fill in place with an index loop so an empty span
is a no-op and the length stays fixed.
2026-09-06 01:12:09 +02:00
dualfroz 9194f6d3ad fix(arrays): return -1 from sorted_last_index_of on empty array
sorted_last_index returns 0 for an empty array (and for any value smaller
than every element), so index becomes -1. The guard only bounded index
from above, so array[-1] was evaluated on an empty list and raised
IndexError. Add the lower-bound check so a negative index is reported as
not found, matching sorted_index_of.
2026-09-04 09:17:47 +02:00
dualfroz 7fc28b38e1 fix(strings): keep last char when truncate separator is absent
str.rfind returns -1 when a string separator is not present in the
truncated text. Using that -1 as a slice end dropped an extra trailing
character before appending the omission. Only adjust the truncation point
when the separator is actually found, matching the regex-separator branch
and lodash behaviour.
2026-09-04 09:04:55 +02:00