summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-01-01 19:56:11 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-01-01 19:56:11 -0800
commit6ac45e04ea817dcd6df3a749f523ed1b96ec0118 (patch)
treebfd8211f0d14cbc1978b231b3a2504209f72aa24 /hash.c
parent79a90b980192de7410a7e688e1c831f7878f8714 (diff)
downloadtxr-6ac45e04ea817dcd6df3a749f523ed1b96ec0118.tar.gz
txr-6ac45e04ea817dcd6df3a749f523ed1b96ec0118.tar.bz2
txr-6ac45e04ea817dcd6df3a749f523ed1b96ec0118.zip
Use rplaca and rplacd instead of set over car_l/cdr_l.
This reduces the proliferation of car_l and cdr_l. With this change, nreverse should work on chains of objects that implement rplacd. * combi.c (comb_gen_fun_common, rcomb_gen_fun_common): Use rplaca. * eval.c (mappendv, mapdov): Likewise * hash.c (hash_equal_op): Likewise. * lib.c (nreverse, acons_new, aconsql_new, sort_list): Use rplaca and rplacd. * match.c (dest_set, v_gather, v_collect, v_flatten, v_cat, v_output, v_filter): Likewise * parser.c (ensure_parser): Use sys_rplacd. * unwind.c (uw_register_subtype): Use rplacd.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hash.c b/hash.c
index b0d76175..e2ea6a43 100644
--- a/hash.c
+++ b/hash.c
@@ -344,8 +344,8 @@ static val hash_equal_op(val left, val right)
free_conses = loc;
} else {
ncons = or2(pop(&free_conses), cons(nil, nil));
- set(car_l(ncons), lcell);
- set(cdr_l(ncons), pending);
+ rplaca(ncons, lcell);
+ rplaca(ncons, pending);
pending = ncons;
}
@@ -363,8 +363,8 @@ static val hash_equal_op(val left, val right)
free_conses = loc;
} else {
ncons = or2(pop(&free_conses), cons(nil, nil));
- set(car_l(ncons), rcell);
- set(cdr_l(ncons), pending);
+ rplaca(ncons, rcell);
+ rplaca(ncons, pending);
pending = ncons;
}
}