Skip to content

Commit

Permalink
Merge pull request #3277 from kavalee/slice-unique-fixes
Browse files Browse the repository at this point in the history
fixed slice.unique and slice.unique_proc
  • Loading branch information
gingerBill committed Mar 14, 2024
2 parents 45d5066 + ac634ac commit 51d6a25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/slice/slice.odin
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down

0 comments on commit 51d6a25

Please sign in to comment.