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

array: remove temporary repeat2()

This commit is contained in:
Alexander Medvednikov
2019-09-19 05:22:24 +03:00
parent cb31eeec55
commit a94c1556ce
10 changed files with 11 additions and 26 deletions

View File

@@ -86,21 +86,6 @@ pub fn (a array) repeat(nr_repeats int) array {
return arr
}
// TODO remove
pub fn (a array) repeat2(nr_repeats int) array {
arr := array {
len: nr_repeats
cap: nr_repeats
element_size: a.element_size
data: malloc(nr_repeats * a.element_size)
}
val := a.data + 0 //nr_repeats * a.element_size
for i := 0; i < nr_repeats; i++ {
C.memcpy(arr.data + i * a.element_size, val, a.element_size)
}
return arr
}
pub fn (a mut array) sort_with_compare(compare voidptr) {
C.qsort(a.data, a.len, a.element_size, compare)
}