From c207921cfa261f84ebd04dccc417a7cc61465c51 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Fri, 22 Aug 2025 08:05:10 +0300 Subject: [PATCH] scm: all_labels: use cons instead of append it's faster. --- scm/mu-scm-store.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scm/mu-scm-store.cc b/scm/mu-scm-store.cc index 2dc5fed6..bd96e2be 100644 --- a/scm/mu-scm-store.cc +++ b/scm/mu-scm-store.cc @@ -184,10 +184,9 @@ subr_cc_store_all_labels(SCM store_scm) try { SCM labels{SCM_EOL}; for (const auto& [label, _n]: label_map) - labels = scm_append_x( - scm_list_2(labels, - scm_list_1(to_scm(label)))); - return labels; + labels = scm_cons(to_scm(label), labels); + + return scm_reverse_x(labels, SCM_EOL); } catch (const ScmError& err) { err.throw_scm();