1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: support also [abc,def].sort(b>a)

This commit is contained in:
Delyan Angelov
2020-10-06 21:32:32 +03:00
parent f7decfe399
commit ce302c29e4
2 changed files with 23 additions and 0 deletions

View File

@ -1014,6 +1014,16 @@ pub fn compare_strings(a, b &string) int {
return 0
}
fn compare_strings_reverse(a, b &string) int {
if a.lt(b) {
return 1
}
if a.gt(b) {
return -1
}
return 0
}
fn compare_strings_by_len(a, b &string) int {
if a.len < b.len {
return -1