Commit 4050f34
committed
refactor: use 'slices.Backward' for backward slice loop
In Go 1.23 and later, `slices.Backward` returns an iterator that ranges over a slice from the last element to the first.
This removes manual index handling and helps avoid off-by-one errors.
Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>1 parent 2ce3566 commit 4050f34
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
956 | 957 | | |
957 | 958 | | |
958 | 959 | | |
959 | | - | |
| 960 | + | |
960 | 961 | | |
961 | 962 | | |
962 | 963 | | |
963 | 964 | | |
964 | | - | |
| 965 | + | |
965 | 966 | | |
966 | 967 | | |
967 | 968 | | |
| |||
0 commit comments