string: optimize eq

pull/4594/head
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
1 changed files with 1 additions and 6 deletions

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
}
// !=