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:
parent
b7e5be41f5
commit
d72e401378
@ -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
|
||||
}
|
||||
|
||||
// !=
|
||||
|
Loading…
Reference in New Issue
Block a user