Skip to content

Commit

Permalink
Explicitly use value type in apply
Browse files Browse the repository at this point in the history
  • Loading branch information
akleeman committed Mar 28, 2020
1 parent 8ec8b0d commit 978fcf7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/albatross/src/indexing/async_apply.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ template <typename ValueType, typename ApplyFunction,
int>::type = 0>
inline void async_apply(const std::vector<ValueType> &xs, ApplyFunction &&f) {
std::vector<std::future<void>> futures;
for (const auto &x : xs) {
for (const ValueType &x : xs) {
futures.emplace_back(async_safe(f, x));
}
for (auto &f : futures) {
Expand All @@ -51,7 +51,7 @@ template <typename ValueType, typename ApplyFunction,
int>::type = 0>
inline auto async_apply(const std::vector<ValueType> &xs, ApplyFunction &&f) {
std::vector<std::future<ApplyType>> futures;
for (const auto &x : xs) {
for (const ValueType &x : xs) {
futures.emplace_back(async_safe(f, x));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_executable(albatross_unit_tests
test_apply.cc
test_async_utils.cc
test_async_apply.cc
test_block_utils.cc
test_call_trace.cc
test_callers.cc
Expand Down
1 change: 0 additions & 1 deletion tests/test_async_utils.cc → tests/test_async_apply.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <gtest/gtest.h>

#include <albatross/Indexing>
#include <albatross/utils/AsyncUtils>
#include <albatross/utils/RandomUtils>

#include <chrono>
Expand Down

0 comments on commit 978fcf7

Please sign in to comment.