This commit is contained in:
2025-01-02 12:01:45 -06:00
parent 5bd7ded7d9
commit 270df62dbe

View File

@ -97,7 +97,7 @@ void file_manager::close_timed_out_files() {
auto closeable_list =
std::accumulate(open_file_lookup_.begin(), open_file_lookup_.end(),
std::vector<std::shared_ptr<i_closeable_open_file>>{},
[](auto items, const auto &item) -> auto {
[](auto &&items, auto &&item) -> auto {
if (item.second->get_open_file_count() == 0U &&
item.second->can_close()) {
items.push_back(item.second);
@ -272,7 +272,7 @@ auto file_manager::get_open_files() const
recur_mutex_lock open_lock(open_file_mtx_);
return std::accumulate(open_file_lookup_.begin(), open_file_lookup_.end(),
std::unordered_map<std::string, std::size_t>{},
[](auto map, const auto &item) -> std::size_t {
[](auto &&map, auto &&item) -> auto {
map[item.first] = item.second->get_open_file_count();
return map;
});
@ -280,11 +280,11 @@ auto file_manager::get_open_files() const
auto file_manager::get_open_handle_count() const -> std::size_t {
recur_mutex_lock open_lock(open_file_mtx_);
return std::accumulate(
open_file_lookup_.begin(), open_file_lookup_.end(), std::size_t(0U),
[](std::size_t count, const auto &item) -> std::size_t {
return count + item.second->get_open_file_count();
});
return std::accumulate(open_file_lookup_.begin(), open_file_lookup_.end(),
std::size_t(0U),
[](auto &&count, auto &&item) -> auto {
return count + item.second->get_open_file_count();
});
}
auto file_manager::get_stored_downloads() const