aboutsummaryrefslogtreecommitdiff
path: root/core/slice/slice.odin
diff options
context:
space:
mode:
authorAaron Kavaler <aaron@kavamail.net>2024-03-13 19:19:31 -0700
committerAaron Kavaler <aaron@kavamail.net>2024-03-13 19:19:31 -0700
commitac634acd4beec5fec267787ec28c3538fc7af4c8 (patch)
treeef66e663124354cacb9618d6089355faf3e2855b /core/slice/slice.odin
parent45d50660296b725c8642b5374062838f7bead09f (diff)
fixed slice.unique and slice.unique_proc
Diffstat (limited to 'core/slice/slice.odin')
-rw-r--r--core/slice/slice.odin4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/slice/slice.odin b/core/slice/slice.odin
index 88f8cb799..dd8d9868a 100644
--- a/core/slice/slice.odin
+++ b/core/slice/slice.odin
@@ -497,8 +497,8 @@ unique :: proc(s: $S/[]$T) -> S where intrinsics.type_is_comparable(T) #no_bound
for j in 1..<len(s) {
if s[j] != s[j-1] && i != j {
s[i] = s[j]
+ i += 1
}
- i += 1
}
return s[:i]
@@ -515,8 +515,8 @@ unique_proc :: proc(s: $S/[]$T, eq: proc(T, T) -> bool) -> S #no_bounds_check {
for j in 1..<len(s) {
if !eq(s[j], s[j-1]) && i != j {
s[i] = s[j]
+ i += 1
}
- i += 1
}
return s[:i]