mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: restrict numeric promotions to cases where no data is lost
This commit is contained in:
@ -360,9 +360,9 @@ pub fn (b []byte) hex() string {
|
||||
mut dst_i := 0
|
||||
for i in b {
|
||||
n0 := i >> 4
|
||||
hex[dst_i++] = if n0 < 10 { n0 + `0` } else { n0 + 87 }
|
||||
hex[dst_i++] = if n0 < 10 { n0 + `0` } else { n0 + byte(87) }
|
||||
n1 := i & 0xF
|
||||
hex[dst_i++] = if n1 < 10 { n1 + `0` } else { n1 + 87 }
|
||||
hex[dst_i++] = if n1 < 10 { n1 + `0` } else { n1 + byte(87) }
|
||||
}
|
||||
hex[dst_i] = `\0`
|
||||
return tos(hex,dst_i)
|
||||
|
Reference in New Issue
Block a user