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

@@ -7,11 +7,11 @@ module strings
// dynamically growing buffer, then use the resulting large string. Using
// a string builder is much better for performance/memory usage than doing
// constantly string concatenation.
pub type Builder = []byte
pub type Builder = []u8
// new_builder returns a new string builder, with an initial capacity of `initial_size`
pub fn new_builder(initial_size int) Builder {
mut res := Builder([]byte{cap: initial_size})
mut res := Builder([]u8{cap: initial_size})
unsafe { res.flags.set(.noslices) }
return res
}
@@ -61,7 +61,7 @@ pub fn (mut b Builder) write_u8(data byte) {
}
// write implements the Writer interface
pub fn (mut b Builder) write(data []byte) ?int {
pub fn (mut b Builder) write(data []u8) ?int {
if data.len == 0 {
return 0
}