Skip to content

Commit 2e64204

Browse files
committed
remove unnecessary template param
Signed-off-by: niranda perera <niranda.perera@gmail.com>
1 parent d96de7c commit 2e64204

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

cpp/src/shuffler/shuffler.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,9 +805,7 @@ void Shuffler::wait_on(PartID pid, std::optional<std::chrono::milliseconds> time
805805
Shuffler::FinishedCbId Shuffler::register_finished_callback(
806806
FinishedCallback&& on_finished_cb
807807
) {
808-
return finish_counter_.register_finished_callback(
809-
std::forward<FinishedCallback>(on_finished_cb)
810-
);
808+
return finish_counter_.register_finished_callback(std::move(on_finished_cb));
811809
}
812810

813811
void Shuffler::remove_finished_callback(FinishedCbId callback_id) {

cpp/tests/test_shuffler.cpp

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -783,18 +783,15 @@ TEST(Shuffler, SpillOnInsertAndExtraction) {
783783
/**
784784
* @brief A test util that runs the wait test by first calling wait_fn lambda with no
785785
* partitions finished, and then with one partition finished. Former case, should timeout,
786-
* while the latter should pass. Since each wait function (wait, wait_on) has different
787-
* output types, extract_pid_fn lambda is used to extract the pid from the output.
786+
* while the latter should pass.
788787
*
789788
* @tparam WaitFn a lambda that takes FinishCounter and PartID as arguments and returns
790-
* the result of the wait function.* @tparam ExctractPidFn a lambda that takes the result
791-
* of WaitFn and returns the PID extracted from the result.
789+
* the result of the wait function.
792790
*
793791
* @param wait_fn wait lambda
794-
* @param extract_pid_fn extract partition ID lambda
795792
*/
796-
template <typename WaitFn, typename ExctractPidFn>
797-
void run_wait_test(WaitFn&& wait_fn, ExctractPidFn&& extract_pid_fn) {
793+
template <typename WaitFn>
794+
void run_wait_test(WaitFn&& wait_fn) {
798795
rapidsmpf::shuffler::PartID out_nparts = 20;
799796
auto comm = GlobalEnvironment->comm_;
800797

@@ -834,28 +831,26 @@ void run_wait_test(WaitFn&& wait_fn, ExctractPidFn&& extract_pid_fn) {
834831
}
835832

836833
// pass the wait_fn result to extract_pid_fn. It should return p_id
837-
EXPECT_EQ(p_id, extract_pid_fn(wait_fn(finish_counter, p_id)));
834+
EXPECT_EQ(p_id, wait_fn(finish_counter, p_id));
838835
}
839836

840837
TEST(FinishCounterTests, wait_with_timeout) {
841-
ASSERT_NO_FATAL_FAILURE(run_wait_test(
842-
[](rapidsmpf::shuffler::detail::FinishCounter& finish_counter,
843-
rapidsmpf::shuffler::PartID const& /* exp_pid */) {
838+
ASSERT_NO_FATAL_FAILURE(
839+
run_wait_test([](rapidsmpf::shuffler::detail::FinishCounter& finish_counter,
840+
rapidsmpf::shuffler::PartID const& /* exp_pid */) {
844841
return finish_counter.wait_any(std::chrono::milliseconds(10));
845-
},
846-
std::identity{}
847-
));
842+
})
843+
);
848844
}
849845

850846
TEST(FinishCounterTests, wait_on_with_timeout) {
851-
ASSERT_NO_FATAL_FAILURE(run_wait_test(
852-
[&](rapidsmpf::shuffler::detail::FinishCounter& finish_counter,
853-
rapidsmpf::shuffler::PartID const& exp_pid) {
847+
ASSERT_NO_FATAL_FAILURE(
848+
run_wait_test([&](rapidsmpf::shuffler::detail::FinishCounter& finish_counter,
849+
rapidsmpf::shuffler::PartID const& exp_pid) {
854850
finish_counter.wait_on(exp_pid, std::chrono::milliseconds(10));
855851
return exp_pid; // return expected PID as wait_on return void
856-
},
857-
std::identity{}
858-
));
852+
})
853+
);
859854
}
860855

861856
class FinishCounterMultithreadingTest

0 commit comments

Comments
 (0)