Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
changeset 783:7d44112dfb81
farray.sh: Use plain insertion sort by default now instead of dumpsort and use Shell sort for array with length > 8
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 26 Oct 2024 18:38:05 +0200 |
| parents | 11f3101c1980 |
| children | b5b19c62da24 |
| files | share/local-bsdtools/farray.sh |
| diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/share/local-bsdtools/farray.sh Sat Oct 26 18:35:37 2024 +0200 +++ b/share/local-bsdtools/farray.sh Sat Oct 26 18:38:05 2024 +0200 @@ -1627,8 +1627,12 @@ _farr_array_get_meta "$@" - # XXX TBD: Select a method depenting on `__farr_len`. - _farr_array_insertionsort + if [ "${__farr_len}" -le 8 ]; then + + _farr_array_insertionsort + else + _farr_array_shellsort + fi }
