From fca8092523033ab1804f0d6f0461530b22655945 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 1 Sep 2023 10:04:01 +0300 Subject: [PATCH] builtin: fix the wording of panic messages, about sorting not working with -freestanding Thanks @MPetr for spotting it. --- vlib/builtin/array.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/builtin/array.v b/vlib/builtin/array.v index 9ccd47642f..41769cb379 100644 --- a/vlib/builtin/array.v +++ b/vlib/builtin/array.v @@ -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) }