mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-05 03:50:41 -08:00
seqlib: stable-sort: fix bogus optimization's in #'stable-sort.
This patch fixes bug #292, where #'stable-sort weren't sorting in place strings, when provided with predicate #'char-greaterp. This was due to optimization, where if sequence was of type string or vector-bit function #'sort was called (which invoked #'quicksort), while for the rest cases merge-sort is used. Optimization is reduced to use quicksort only on vector-bit sequences. See: http://sourceforge.net/p/ecls/bugs/292/
This commit is contained in:
parent
642b4f9e71
commit
4570e2192c
1 changed files with 1 additions and 1 deletions
|
|
@ -882,7 +882,7 @@ SEQUENCE. See SORT."
|
|||
predicate (si::coerce-to-function predicate))
|
||||
(if (listp sequence)
|
||||
(list-merge-sort sequence predicate key)
|
||||
(if (or (stringp sequence) (bit-vector-p sequence))
|
||||
(if (bit-vector-p sequence)
|
||||
(sort sequence predicate :key key)
|
||||
(coerce (list-merge-sort (coerce sequence 'list)
|
||||
predicate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue