mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
builtin: optimize array sort (#9570)
This commit is contained in:
parent
5229428d91
commit
7f81702d81
3 changed files with 3 additions and 119 deletions
|
@ -836,7 +836,7 @@ fn test_sort_by_different_order_of_a_b() {
|
|||
|
||||
fn test_f32_sort() {
|
||||
mut f := [f32(50.0), 15, 1, 79, 38, 0, 27]
|
||||
f.sort_with_compare(compare_f32)
|
||||
f.sort()
|
||||
assert f[0] == 0.0
|
||||
assert f[1] == 1.0
|
||||
assert f[6] == 79.0
|
||||
|
@ -844,7 +844,7 @@ fn test_f32_sort() {
|
|||
|
||||
fn test_f64_sort() {
|
||||
mut f := [50.0, 15, 1, 79, 38, 0, 27]
|
||||
f.sort_with_compare(compare_f64)
|
||||
f.sort()
|
||||
assert f[0] == 0.0
|
||||
assert f[1] == 1.0
|
||||
assert f[6] == 79.0
|
||||
|
@ -852,7 +852,7 @@ fn test_f64_sort() {
|
|||
|
||||
fn test_i64_sort() {
|
||||
mut f := [i64(50), 15, 1, 79, 38, 0, 27]
|
||||
f.sort_with_compare(compare_i64)
|
||||
f.sort()
|
||||
assert f[0] == 0
|
||||
assert f[1] == 1
|
||||
assert f[6] == 79
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue