Skip to content

Commit

Permalink
removed usage of std::ranges::to because emscripten doesn't yet sup…
Browse files Browse the repository at this point in the history
…port it
  • Loading branch information
mgerhold committed Nov 14, 2023
1 parent 47050af commit 5acad7c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/values/builtin_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ namespace values {
using std::ranges::views::split;
using std::ranges::views::transform;
auto const separator = static_cast<char>(values.at(1)->as_char_value().value());
auto parts = values.front()->as_string().string_representation() | split(separator)
| filter([discard_empty](auto const& part) {
return not discard_empty or not std::string_view{ part }.empty();
})
| transform([](auto&& part) {
return String::make(std::string_view{ part }, ValueCategory::Lvalue);
})
| std::ranges::to<std::vector>();
auto parts_view = values.front()->as_string().string_representation() | split(separator)
| filter([discard_empty](auto const& part) {
return not discard_empty or not std::string_view{ part }.empty();
})
| transform([](auto&& part) {
return String::make(std::string_view{ part }, ValueCategory::Lvalue);
});
auto parts = std::vector<Value>{ parts_view.begin(), parts_view.end() };
return Array::make(std::move(parts), ValueCategory::Rvalue);
}
throw WrongArgumentType{ to_view(m_type), "separator", values.at(1)->type() };
Expand Down

0 comments on commit 5acad7c

Please sign in to comment.