diff options
Diffstat (limited to 'netfs/fuse/fuseFiles.cpp')
-rw-r--r-- | netfs/fuse/fuseFiles.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp index 82df245..29a0096 100644 --- a/netfs/fuse/fuseFiles.cpp +++ b/netfs/fuse/fuseFiles.cpp @@ -138,15 +138,14 @@ namespace NetFS { return f(key); } else { - const auto overlap = std::transform_reduce( - R.first, R.second, std::vector<std::shared_future<void>> {}, - [](auto && v, auto && i) { - v.push_back(i); - return std::forward<decltype(v)>(v); - }, - [](auto && i) { - return i.second->future; - }); + const auto overlap = [R]() { + std::vector<std::shared_future<void>> out; + out.reserve(safe<ptrdiff_t> {std::distance(R.first, R.second)}); + std::transform(R.first, R.second, std::back_inserter(out), [](auto && i) { + return i.second->future; + }); + return out; + }(); // Wait for them whilst unlocked lock.release()->unlock(); try { |