mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: improve checking of a << b, when a and b are numbers (#12589)
This commit is contained in:
@ -14,8 +14,8 @@ mut:
|
||||
text string
|
||||
}
|
||||
|
||||
fn (mut s ChunkScanner) read_chunk_size() int {
|
||||
mut n := 0
|
||||
fn (mut s ChunkScanner) read_chunk_size() u32 {
|
||||
mut n := u32(0)
|
||||
for {
|
||||
if s.pos >= s.text.len {
|
||||
break
|
||||
@ -25,7 +25,7 @@ fn (mut s ChunkScanner) read_chunk_size() int {
|
||||
break
|
||||
}
|
||||
n = n << 4
|
||||
n += int(unhex(c))
|
||||
n += u32(unhex(c))
|
||||
s.pos++
|
||||
}
|
||||
return n
|
||||
@ -46,9 +46,9 @@ fn (mut s ChunkScanner) skip_crlf() {
|
||||
s.pos += 2
|
||||
}
|
||||
|
||||
fn (mut s ChunkScanner) read_chunk(chunksize int) string {
|
||||
fn (mut s ChunkScanner) read_chunk(chunksize u32) string {
|
||||
startpos := s.pos
|
||||
s.pos += chunksize
|
||||
s.pos += int(chunksize)
|
||||
return s.text[startpos..s.pos]
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user