From 618a8ddd7dfc9a33d7d6aac94a82eac13deca0d1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 31 Jan 2021 23:12:32 -0800 Subject: 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. --- lib.c | 7 +------ 1 file changed, 1 insertion(+), 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); -- cgit v1.2.3