1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: fix in for various numeric types (#6311)

This commit is contained in:
Uwe Krüger
2020-09-06 12:45:02 +02:00
committed by GitHub
parent b4b898b769
commit 047bf02985
4 changed files with 60 additions and 2 deletions

View File

@@ -393,6 +393,16 @@ pub fn (a []byte) contains(val byte) bool {
return false
}
// TODO generic
pub fn (a []u16) contains(val u16) bool {
for aa in a {
if aa == val {
return true
}
}
return false
}
// TODO generic
fn (ar []int) contains(val int) bool {
for s in ar {