Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Remove redundant args & fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneAlex committed Aug 17, 2023
1 parent 32d3336 commit e052a0b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions include/kstd/streams/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,10 @@ namespace kstd::streams {
return result;
}

template<template<typename, typename, typename...> typename MAP, typename... PROPS, typename KM, typename VM,
typename... ARGS>
template<template<typename, typename, typename...> typename MAP, typename... PROPS, typename KM, typename VM>
constexpr auto
collect_map_into(MAP<std::invoke_result_t<KM, ValueType&>, std::invoke_result_t<VM, ValueType&>, PROPS...>& map,
KM&& key_mapper, VM&& value_mapper, ARGS&&... args) noexcept -> void {
KM&& key_mapper, VM&& value_mapper) noexcept -> void {
auto element = _pipe.get_next();
while(element) {
auto& value = *element;
Expand Down
2 changes: 1 addition & 1 deletion test/test_find.cpp → test/test_find_first.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TEST(kstd_streams_Stream, test_find_value) {
const std::vector<kstd::u32> values {1, 11, 111, 1111, 11111, 111111};
// clang-format off
const auto first_value = stream(values)
.find([](auto& value) {
.find_first([](auto& value) {
return value << 1 == 222;
});
// clang-format on
Expand Down
4 changes: 2 additions & 2 deletions test/test_linked_struct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TEST(kstd_streams_Stream, test_linked_struct_pointer) {
kstd::usize index = 0;

// clang-format off
stream(first, KSTD_FIELD_FUNCTOR(next)).for_each([&](auto& value) {
stream(first, KSTD_PTR_FIELD_FUNCTOR(next)).for_each([&](auto& value) {
switch(index) {
case 0: ASSERT_EQ(first, &value); break;
case 1: ASSERT_EQ(second, &value); break;
Expand Down Expand Up @@ -76,7 +76,7 @@ TEST(kstd_streams_Stream, test_linked_struct_const_pointer) {
const auto* const_first = reinterpret_cast<const SomeLinkedList*>(first);// NOLINT

// clang-format off
stream(const_first, KSTD_FIELD_FUNCTOR(next)).for_each([&](const auto& value) {
stream(const_first, KSTD_PTR_FIELD_FUNCTOR(next)).for_each([&](const auto& value) {
switch(index) {
case 0: ASSERT_EQ(first, &value); break;
case 1: ASSERT_EQ(second, &value); break;
Expand Down

0 comments on commit e052a0b

Please sign in to comment.