mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
cgen: operator overloading
This commit is contained in:
parent
3521b7ff89
commit
a08e64f37f
6 changed files with 85 additions and 45 deletions
|
@ -271,11 +271,11 @@ pub fn len_16(x u16) int {
|
|||
pub fn len_32(x u32) int {
|
||||
mut y := x
|
||||
mut n := 0
|
||||
if y >= 1<<16 {
|
||||
if y >= (1<<16) {
|
||||
y >>= 16
|
||||
n = 16
|
||||
}
|
||||
if y >= 1<<8 {
|
||||
if y >= (1<<8) {
|
||||
y >>= 8
|
||||
n += 8
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue