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

string: optimize eq

This commit is contained in:
ka-weihe 2020-04-25 20:19:53 +02:00 committed by GitHub
parent b7e5be41f5
commit d72e401378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -340,12 +340,7 @@ fn (s string) eq(a string) bool {
if s.len != a.len {
return false
}
for i in 0..s.len {
if s[i] != a[i] {
return false
}
}
return true
return C.memcmp(s.str, a.str, a.len) == 0
}
// !=