1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: replace []byte with []u8

This commit is contained in:
Alexander Medvednikov
2022-04-15 15:35:35 +03:00
parent 0527ac633e
commit fb192d949b
164 changed files with 533 additions and 533 deletions

View File

@@ -182,11 +182,11 @@ pub fn parse_request(mut reader io.BufferedReader) ?Request {
mut request := parse_request_head(mut reader) ?
// body
mut body := []byte{}
mut body := []u8{}
if length := request.header.get(.content_length) {
n := length.int()
if n > 0 {
body = []byte{len: n}
body = []u8{len: n}
mut count := 0
for count < body.len {
count += reader.read(mut body[count..]) or { break }

View File

@@ -8,7 +8,7 @@ mut:
place int
}
fn (mut s StringReader) read(mut buf []byte) ?int {
fn (mut s StringReader) read(mut buf []u8) ?int {
if s.place >= s.text.len {
return none
}

View File

@@ -21,8 +21,8 @@ fn (mut resp Response) free() {
}
// Formats resp to bytes suitable for HTTP response transmission
pub fn (resp Response) bytes() []byte {
// TODO: build []byte directly; this uses two allocations
pub fn (resp Response) bytes() []u8 {
// TODO: build []u8 directly; this uses two allocations
return resp.bytestr().bytes()
}