Skip to content

Commit 978fcf7

Browse files
committed
Explicitly use value type in apply
1 parent 8ec8b0d commit 978fcf7

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

include/albatross/src/indexing/async_apply.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ template <typename ValueType, typename ApplyFunction,
3434
int>::type = 0>
3535
inline void async_apply(const std::vector<ValueType> &xs, ApplyFunction &&f) {
3636
std::vector<std::future<void>> futures;
37-
for (const auto &x : xs) {
37+
for (const ValueType &x : xs) {
3838
futures.emplace_back(async_safe(f, x));
3939
}
4040
for (auto &f : futures) {
@@ -51,7 +51,7 @@ template <typename ValueType, typename ApplyFunction,
5151
int>::type = 0>
5252
inline auto async_apply(const std::vector<ValueType> &xs, ApplyFunction &&f) {
5353
std::vector<std::future<ApplyType>> futures;
54-
for (const auto &x : xs) {
54+
for (const ValueType &x : xs) {
5555
futures.emplace_back(async_safe(f, x));
5656
}
5757

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
add_executable(albatross_unit_tests
22
test_apply.cc
3-
test_async_utils.cc
3+
test_async_apply.cc
44
test_block_utils.cc
55
test_call_trace.cc
66
test_callers.cc

tests/test_async_utils.cc renamed to tests/test_async_apply.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <gtest/gtest.h>
1414

1515
#include <albatross/Indexing>
16-
#include <albatross/utils/AsyncUtils>
1716
#include <albatross/utils/RandomUtils>
1817

1918
#include <chrono>

0 commit comments

Comments
 (0)