mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
use slices.Contains.
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
package utils
|
||||
|
||||
func ArrayIn[T comparable](val T, array []T) (exists bool, index int) {
|
||||
exists, index = false, -1
|
||||
|
||||
for i, a := range array {
|
||||
if a == val {
|
||||
exists, index = true, i
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user