mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
remove u8 and i32 from tests and examples
This commit is contained in:
@ -81,20 +81,20 @@ pub fn (nn u32) str() string {
|
||||
}
|
||||
|
||||
/*
|
||||
pub fn (nn u8) str() string {
|
||||
pub fn (nn byte) str() string {
|
||||
mut n := nn
|
||||
if n == u8(0) {
|
||||
if n == byte(0) {
|
||||
return '0'
|
||||
}
|
||||
max := 5
|
||||
mut buf := malloc(max)
|
||||
mut len := 0
|
||||
// Fill the string from the end
|
||||
for n > u8(0) {
|
||||
d := n % u8(10)
|
||||
buf[max - len - 1] = d + u8(`0`)
|
||||
for n > byte(0) {
|
||||
d := n % byte(10)
|
||||
buf[max - len - 1] = d + byte(`0`)
|
||||
len++
|
||||
n = n / u8(10)
|
||||
n = n / byte(10)
|
||||
}
|
||||
return tos(buf + max - len, len)
|
||||
}
|
||||
|
Reference in New Issue
Block a user