diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-01-29 18:41:33 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-01-29 18:41:33 -0800 |
commit | 0b9b94005f540e3d4010338c44468aad1f173293 (patch) | |
tree | c0851434dae3a8ef1bdb10994542f16d696a2450 /INSTALL | |
parent | 12b57f23dcd4f0e42b14a4f375b334be6c7c55a3 (diff) | |
download | txr-0b9b94005f540e3d4010338c44468aad1f173293.tar.gz txr-0b9b94005f540e3d4010338c44468aad1f173293.tar.bz2 txr-0b9b94005f540e3d4010338c44468aad1f173293.zip |
bugfix: make list sorting stable, as documented.
* lib.c (merge): Fix unstable logic here. What we want is
that when the item from list1 is *not less* than the item
from list2, we take them in that order. Since all we have
is a less function, we must test (less item2 item1).
If this is false, then preserve the order, because when
the keys are identical, the less function yields false.
(sort_list): A similar change takes place here when we sort
a list of length two (which is essentially an inlined
case of merge).
Diffstat (limited to 'INSTALL')
0 files changed, 0 insertions, 0 deletions