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 {
|
if s.len != a.len {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
for i in 0..s.len {
|
return C.memcmp(s.str, a.str, a.len) == 0
|
||||||
if s[i] != a[i] {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// !=
|
// !=
|
||||||
|
Loading…
Reference in New Issue
Block a user