From e41878a64f3de4ba1eefe9f2364156f3065e4a40 Mon Sep 17 00:00:00 2001 From: Sandro Cavazzoni Date: Sun, 16 Jun 2024 11:36:20 +0200 Subject: [PATCH] Fix `slice.unique` wrong result When you try to make this array unique `[]int{1, 2, 4, 4, 5}` you get `[]int{1, 4, 5}` instead of `[]int{1, 2, 4, 5}`. Our index `i` should be increased even with both indices `i` and `j` have the same value --- core/slice/slice.odin | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/slice/slice.odin b/core/slice/slice.odin index d8f4df88e..06f08fda2 100644 --- a/core/slice/slice.odin +++ b/core/slice/slice.odin @@ -495,8 +495,10 @@ unique :: proc(s: $S/[]$T) -> S where intrinsics.type_is_comparable(T) #no_bound } i := 1 for j in 1.. bool) -> S #no_bounds_check { } i := 1 for j in 1..