scm: to_scm: use cons, not append
It's faster.
This commit is contained in:
@ -223,9 +223,8 @@ namespace Mu::Scm {
|
|||||||
return scm_from_utf8_string(val);
|
return scm_from_utf8_string(val);
|
||||||
else if constexpr (std::is_same_v<Type, std::vector<std::string>>) {
|
else if constexpr (std::is_same_v<Type, std::vector<std::string>>) {
|
||||||
SCM lst{SCM_EOL};
|
SCM lst{SCM_EOL};
|
||||||
for (const auto& s: val)
|
for (auto it = val.end(); it-- != val.begin();)
|
||||||
lst = scm_append_x(scm_list_2(lst,
|
lst = scm_cons(to_scm(*it), lst);
|
||||||
scm_list_1(to_scm(s))));
|
|
||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
else if constexpr (std::is_same_v<Type, bool>)
|
else if constexpr (std::is_same_v<Type, bool>)
|
||||||
|
|||||||
Reference in New Issue
Block a user