Skip to content

Commit

Permalink
builtin: fix the wording of panic messages, about sorting not working…
Browse files Browse the repository at this point in the history
… with -freestanding

Thanks @mpetr for spotting it.
  • Loading branch information
spytheman committed Sep 1, 2023
1 parent 58b6ba8 commit fca8092
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/builtin/array.v
Expand Up @@ -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) }
}
Expand All @@ -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) }
Expand Down

0 comments on commit fca8092

Please sign in to comment.