builtin/array: make push_many private
parent
875ad1f6ea
commit
2021c869cf
|
|
@ -594,7 +594,7 @@ fn (mut a array) push(val voidptr) {
|
||||||
// push_many implements the functionality for pushing another array.
|
// push_many implements the functionality for pushing another array.
|
||||||
// `val` is array.data and user facing usage is `a << [1,2,3]`
|
// `val` is array.data and user facing usage is `a << [1,2,3]`
|
||||||
[unsafe]
|
[unsafe]
|
||||||
pub fn (mut a3 array) push_many(val voidptr, size int) {
|
fn (mut a3 array) push_many(val voidptr, size int) {
|
||||||
a3.ensure_cap(a3.len + size)
|
a3.ensure_cap(a3.len + size)
|
||||||
if a3.data == val && !isnil(a3.data) {
|
if a3.data == val && !isnil(a3.data) {
|
||||||
// handle `arr << arr`
|
// handle `arr << arr`
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ pub fn (mut ctx Context) write(s string) {
|
||||||
if s == '' {
|
if s == '' {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
unsafe { ctx.print_buf.push_many(s.str, s.len) }
|
tmp := unsafe { s.str.vbytes(s.len) }
|
||||||
|
ctx.print_buf << tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
// flush displays the accumulated print buffer to the screen.
|
// flush displays the accumulated print buffer to the screen.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue