Quicksort and insertsort incorrectly allowing arrays and vectors by value. #1845.

This commit is contained in:
Christoffer Lerno
2025-01-15 13:31:29 +01:00
parent 29a6a0db32
commit 2f7d18bfb8
7 changed files with 43 additions and 12 deletions

View File

@@ -21,6 +21,8 @@ macro bool @is_sortable(#list)
return false;
$case !$defined(#list.len):
return false;
$case @typekind(#list) == VECTOR || @typekind(#list) == ARRAY:
return false;
$case $defined(&#list[0]) &&& !types::is_same($typeof(&#list[0]), $typeof(#list[0])*):
return false;
$default: