mirror of
https://github.com/vlang/v.git
synced 2025-09-22 11:57:33 -04:00
builtin: fix the wording of panic messages, about sorting not working with -freestanding
Thanks @MPetr for spotting it.
This commit is contained in:
parent
58b6ba81d1
commit
fca8092523
@ -859,7 +859,7 @@ pub fn (a &array) sorted(callback fn (voidptr, voidptr) int) array
|
|||||||
// ```
|
// ```
|
||||||
pub fn (mut a array) sort_with_compare(callback fn (voidptr, voidptr) int) {
|
pub fn (mut a array) sort_with_compare(callback fn (voidptr, voidptr) int) {
|
||||||
$if freestanding {
|
$if freestanding {
|
||||||
panic('sort does not work with -freestanding')
|
panic('sort_with_compare does not work with -freestanding')
|
||||||
} $else {
|
} $else {
|
||||||
unsafe { vqsort(a.data, usize(a.len), usize(a.element_size), callback) }
|
unsafe { vqsort(a.data, usize(a.len), usize(a.element_size), callback) }
|
||||||
}
|
}
|
||||||
@ -870,7 +870,7 @@ pub fn (mut a array) sort_with_compare(callback fn (voidptr, voidptr) int) {
|
|||||||
// See also .sort_with_compare()
|
// See also .sort_with_compare()
|
||||||
pub fn (a &array) sorted_with_compare(callback fn (voidptr, voidptr) int) array {
|
pub fn (a &array) sorted_with_compare(callback fn (voidptr, voidptr) int) array {
|
||||||
$if freestanding {
|
$if freestanding {
|
||||||
panic('sort does not work with -freestanding')
|
panic('sorted_with_compare does not work with -freestanding')
|
||||||
} $else {
|
} $else {
|
||||||
mut r := a.clone()
|
mut r := a.clone()
|
||||||
unsafe { vqsort(r.data, usize(r.len), usize(r.element_size), callback) }
|
unsafe { vqsort(r.data, usize(r.len), usize(r.element_size), callback) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user