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:
@ -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
|
||||
|
Reference in New Issue
Block a user