Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
astrophysik committed Jan 20, 2025
1 parent ccf5f32 commit 2b8a31a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions runtime-light/stdlib/array/array-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
namespace dl {

template<typename T, typename Comparator>
requires(std::invocable<Comparator, T, T>) task_t<void> sort(T *begin_init, T *end_init, Comparator &&compare) noexcept{
auto compare_call = [&compare]<typename U>(U &&lhs, U &&rhs) -> task_t<int64_t> {
requires(std::invocable<Comparator, T, T>) task_t<void> sort(T *begin_init, T *end_init, Comparator &&compare) noexcept {
auto compare_call = [compare]<typename U>(U &&lhs, U &&rhs) -> task_t<int64_t> {
if constexpr (is_async_function_v<Comparator, U, U>) {
co_return co_await std::invoke(std::forward<Comparator>(compare), std::forward<U>(lhs), std::forward<U>(rhs));
} else {
Expand Down Expand Up @@ -105,7 +105,7 @@ Result sort(array<U> &arr, Comparator &&comparator, bool renumber) noexcept {
arr.mutate_if_vector_shared();
}

const auto elements_cmp = [&comparator](const U &lhs, const U &rhs) -> task_t<bool> {
const auto elements_cmp = [comparator](const U &lhs, const U &rhs) -> task_t<bool> {
if constexpr (is_async_function_v<Comparator, U, U>) {
co_return(co_await std::invoke(std::forward<Comparator>(comparator), lhs, rhs)) > 0;
} else {
Expand Down Expand Up @@ -135,7 +135,7 @@ Result sort(array<U> &arr, Comparator &&comparator, bool renumber) noexcept {
}
php_assert(i == n);

const auto hash_entry_cmp = [&comparator](const array_bucket *lhs, const array_bucket *rhs) -> task_t<bool> {
const auto hash_entry_cmp = [comparator](const array_bucket *lhs, const array_bucket *rhs) -> task_t<bool> {
if constexpr (is_async_function_v<Comparator, U, U>) {
co_return(co_await std::invoke(comparator, lhs->value, rhs->value)) > 0;
} else {
Expand Down Expand Up @@ -268,7 +268,7 @@ task_t<array<T>> f$array_filter(const array<T> &a) noexcept {
template<class T, class Pred>
requires(std::invocable<Pred, T>) task_t<array<T>> f$array_filter(const array<T> &a, Pred &&pred) noexcept {
if constexpr (is_async_function_v<Pred, T>) {
co_return co_await array_functions_impl_::array_filter_impl(a, [&pred](const auto &it) noexcept -> task_t<bool> {
co_return co_await array_functions_impl_::array_filter_impl(a, [pred](const auto &it) noexcept -> task_t<bool> {
co_return co_await std::invoke(std::forward<Pred>(pred), it.get_value());
});
} else {
Expand Down

0 comments on commit 2b8a31a

Please sign in to comment.