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

v2: minor fixes

This commit is contained in:
Alexander Medvednikov
2020-03-27 08:46:54 +01:00
parent 883a105aca
commit db59c621e8
8 changed files with 91 additions and 74 deletions

View File

@ -15,13 +15,6 @@ pub:
element_size int
}
/*
struct Foo {
a []string
b [][]string
}
*/
// Internal function, used by V (`nums := []int`)
fn new_array(mylen int, cap int, elm_size int) array {
cap_ := if cap == 0 { 1 } else { cap }
@ -39,6 +32,13 @@ pub fn make(len int, cap int, elm_size int) array {
return new_array(len, cap, elm_size)
}
/*
struct Foo {
a []string
b [][]string
}
*/
// Private function, used by V (`nums := [1, 2, 3]`)
fn new_array_from_c_array(len, cap, elm_size int, c_array voidptr) array {
cap_ := if cap == 0 { 1 } else { cap }