summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-10-08 19:13:56 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-10-08 19:13:56 -0700
commit52fed6047b4e12e50912e2561f224889cc2d035d (patch)
tree00cf2dd25b6cec13668af363110898f7e512d122
parent6acdc55506c2da5de12e28e0b8fc405d211e09c5 (diff)
downloadtxr-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.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib.c b/lib.c
index c0ad5c96..30c3c93c 100644
--- a/lib.c
+++ b/lib.c
@@ -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;