mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
checker: improve checking of a << b, when a and b are numbers (#12589)
This commit is contained in:
parent
fe37da31a8
commit
6d97b0a407
33 changed files with 436 additions and 148 deletions
|
@ -46,7 +46,7 @@ pub fn get_uchar(s string, index int) int {
|
|||
if ch_len > 1 && ch_len < 5 {
|
||||
mut lword := 0
|
||||
for i := 0; i < ch_len; i++ {
|
||||
lword = (lword << 8) | int(s[index + i])
|
||||
lword = int(u32(lword) << 8 | u32(s[index + i]))
|
||||
}
|
||||
|
||||
// 2 byte utf-8
|
||||
|
@ -416,7 +416,7 @@ fn up_low(s string, upper_flag bool) string {
|
|||
mut lword := 0
|
||||
|
||||
for i := 0; i < ch_len; i++ {
|
||||
lword = (lword << 8) | int(s[index + i])
|
||||
lword = int(u32(lword) << 8 | u32(s[index + i]))
|
||||
}
|
||||
|
||||
// println("#${index} ($lword)")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue