diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-10-08 19:13:56 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-10-08 19:13:56 -0700 |
commit | 52fed6047b4e12e50912e2561f224889cc2d035d (patch) | |
tree | 00cf2dd25b6cec13668af363110898f7e512d122 | |
parent | 6acdc55506c2da5de12e28e0b8fc405d211e09c5 (diff) | |
download | txr-52fed6047b4e12e50912e2561f224889cc2d035d.tar.gz txr-52fed6047b4e12e50912e2561f224889cc2d035d.tar.bz2 txr-52fed6047b4e12e50912e2561f224889cc2d035d.zip |
sort: remove obsolete comments.
* lib.c (sort_list, sort): Remove comments about dangerous
mutation; these pertain to some explicit logic which existed
in previous versions of the code to handle those situations.
-rw-r--r-- | lib.c | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -8477,10 +8477,6 @@ static val sort_list(val list, val lessfun, val keyfun) funcall1(keyfun, first(list)))) { val cons2 = cdr(list); - /* This assignment is a dangerous mutation since the list - may contain mixtures of old and new objects, and - so we could be reversing a newer->older pointer - relationship. */ rplacd(cons2, list); rplacd(list, nil); return cons2; @@ -8605,13 +8601,8 @@ val sort(val seq_in, val lessfun, val keyfun) keyfun = default_arg(keyfun, identity_f); lessfun = default_arg(lessfun, less_f); - if (consp(seq)) { - /* The list could have a mixture of generation 0 and 1 - objects. Sorting the list could reverse some of the - pointers between the generations resulting in a backpointer. - Thus we better inform the collector about this object. */ + if (consp(seq)) return sort_list(seq, lessfun, keyfun); - } sort_vec(seq, lessfun, keyfun); return seq; |