scm: all_labels: use cons instead of append
it's faster.
This commit is contained in:
@ -184,10 +184,9 @@ subr_cc_store_all_labels(SCM store_scm) try {
|
|||||||
|
|
||||||
SCM labels{SCM_EOL};
|
SCM labels{SCM_EOL};
|
||||||
for (const auto& [label, _n]: label_map)
|
for (const auto& [label, _n]: label_map)
|
||||||
labels = scm_append_x(
|
labels = scm_cons(to_scm(label), labels);
|
||||||
scm_list_2(labels,
|
|
||||||
scm_list_1(to_scm<std::string>(label))));
|
return scm_reverse_x(labels, SCM_EOL);
|
||||||
return labels;
|
|
||||||
|
|
||||||
} catch (const ScmError& err) {
|
} catch (const ScmError& err) {
|
||||||
err.throw_scm();
|
err.throw_scm();
|
||||||
|
|||||||
Reference in New Issue
Block a user