Files
Nim/lib/pure
cui fliter 0ed883ef11 algorithm: handle empty inputs in rotateLeft (#26191)
`rotateLeft` and `rotatedLeft` raised `DivByZeroDefect` for empty
containers because their whole-container overloads computed `dist mod
arg.len` before checking for an empty input.

Handle empty inputs explicitly:

- `rotateLeft` returns `0` and leaves the container unchanged.
- `rotatedLeft` returns an empty sequence.

Add a regression test covering both overloads.

The slice overloads are intentionally left unchanged because zero-length
slice semantics need separate consideration.

Signed-off-by: cuishuang <imcusg@gmail.com>
2026-09-09 10:57:29 +02:00
..
2026-02-10 13:21:35 +01:00
2015-10-01 12:05:45 -07:00
2024-05-16 23:22:49 +02:00
2025-12-21 19:13:25 +01:00
2026-02-10 13:21:35 +01:00
2021-01-09 00:24:41 +01:00
2026-04-02 07:19:43 +02:00
2026-02-10 13:21:35 +01:00
2024-12-20 15:26:30 +01:00
2026-04-02 07:19:43 +02:00
2022-12-03 21:25:49 +08:00
2026-02-20 16:41:06 +01:00
2024-12-20 15:26:30 +01:00
2026-04-02 07:19:43 +02:00
2026-02-23 13:39:55 +01:00