summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-01-31 23:12:32 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-01-31 23:12:32 -0800
commit618a8ddd7dfc9a33d7d6aac94a82eac13deca0d1 (patch)
tree7d623d64e3ccd07e3bd9a8bdfe3904d750a27092
parent7b26a8a95f544c04c20af9fdeac16624685a15b6 (diff)
downloadtxr-618a8ddd7dfc9a33d7d6aac94a82eac13deca0d1.tar.gz
txr-618a8ddd7dfc9a33d7d6aac94a82eac13deca0d1.tar.bz2
txr-618a8ddd7dfc9a33d7d6aac94a82eac13deca0d1.zip
lib: get rid of alist_remove1 function.
* lib.c (delete_package): This is the only user of alist_remove1. It can use remqual with a car_f key, which is more efficient. (alist_remove1): Function removed.
-rw-r--r--lib.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib.c b/lib.c
index a116771a..c4f191bc 100644
--- a/lib.c
+++ b/lib.c
@@ -6011,7 +6011,7 @@ val delete_package(val package_in)
val package = get_package(lit("delete-package"), package_in, nil);
val iter;
loc cpll = cur_package_alist_loc;
- set(cpll, alist_remove1(deref(cpll), package->pk.name));
+ set(cpll, remqual(package->pk.name, deref(cpll), car_f));
for (iter = deref(cpll); iter; iter = cdr(iter))
unuse_package(package, cdar(iter));
return nil;
@@ -9145,11 +9145,6 @@ val alist_removev(val list, struct args *keys)
return alist_remove(list, args_get_list(keys));
}
-val alist_remove1(val list, val key)
-{
- return alist_remove(list, cons(key, nil));
-}
-
val alist_nremove(val list, val keys)
{
loc plist = mkcloc(list);