builtin: fix the wording of panic messages, about sorting not working with -freestanding

Thanks @MPetr for spotting it.
This commit is contained in:
Delyan Angelov 2023-09-01 10:04:01 +03:00
parent 58b6ba81d1
commit fca8092523
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -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) {
$if freestanding {
panic('sort does not work with -freestanding')
panic('sort_with_compare does not work with -freestanding')
} $else {
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()
pub fn (a &array) sorted_with_compare(callback fn (voidptr, voidptr) int) array {
$if freestanding {
panic('sort does not work with -freestanding')
panic('sorted_with_compare does not work with -freestanding')
} $else {
mut r := a.clone()
unsafe { vqsort(r.data, usize(r.len), usize(r.element_size), callback) }