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

builtin: clean up array.v (#12784)

This commit is contained in:
yuyi 2021-12-11 16:17:00 +08:00 committed by GitHub
parent a58c539ee6
commit 7c7cdf8ce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -513,36 +513,24 @@ pub fn (a &array) free() {
// filter creates a new array with all elements that pass the test implemented by the provided function // filter creates a new array with all elements that pass the test implemented by the provided function
pub fn (a array) filter(predicate fn (voidptr) bool) array pub fn (a array) filter(predicate fn (voidptr) bool) array
struct ZZZTmp1 {}
// any tests whether at least one element in the array passes the test implemented by the // any tests whether at least one element in the array passes the test implemented by the
// provided function. It returns true if, in the array, it finds an element for which the provided // provided function. It returns true if, in the array, it finds an element for which the provided
// function returns true; otherwise it returns false. It doesn't modify the array // function returns true; otherwise it returns false. It doesn't modify the array
pub fn (a array) any(predicate fn (voidptr) bool) bool pub fn (a array) any(predicate fn (voidptr) bool) bool
struct ZZZTmp2 {}
// all tests whether all elements in the array pass the test implemented by the provided function // all tests whether all elements in the array pass the test implemented by the provided function
pub fn (a array) all(predicate fn (voidptr) bool) bool pub fn (a array) all(predicate fn (voidptr) bool) bool
struct ZZZTmp3 {}
// map creates a new array populated with the results of calling a provided function // map creates a new array populated with the results of calling a provided function
// on every element in the calling array // on every element in the calling array
pub fn (a array) map(callback fn (voidptr) voidptr) array pub fn (a array) map(callback fn (voidptr) voidptr) array
struct ZZZTmp4 {}
// sort sorts an array in place in ascending order. // sort sorts an array in place in ascending order.
pub fn (mut a array) sort(callback fn (voidptr, voidptr) int) pub fn (mut a array) sort(callback fn (voidptr, voidptr) int)
struct ZZZTmp5 {}
// contains determines whether an array includes a certain value among its entries // contains determines whether an array includes a certain value among its entries
pub fn (a array) contains(val voidptr) bool pub fn (a array) contains(val voidptr) bool
struct ZZZTmp6 {}
// index returns the first index at which a given element can be found in the array // index returns the first index at which a given element can be found in the array
// or -1 if the value is not found. // or -1 if the value is not found.
pub fn (a array) index(value voidptr) int pub fn (a array) index(value voidptr) int