refactor
Some checks are pending
BlockStorage/repertory_linux_builds/pipeline/head Build queued...
BlockStorage/repertory_osx_builds/pipeline/head This commit looks good

This commit is contained in:
2023-11-18 18:19:57 -06:00
parent cb0dde2a80
commit 8555d31ddf
2 changed files with 10 additions and 12 deletions

View File

@ -87,9 +87,9 @@ file_manager::~file_manager() {
void file_manager::close(std::uint64_t handle) {
unique_recur_mutex_lock file_lock(open_file_mtx_);
auto it = open_handle_lookup_.find(handle);
if (it != open_handle_lookup_.end()) {
auto *cur_file = it->second;
auto iter = open_handle_lookup_.find(handle);
if (iter != open_handle_lookup_.end()) {
auto *cur_file = iter->second;
open_handle_lookup_.erase(handle);
cur_file->remove(handle);
@ -109,9 +109,9 @@ void file_manager::close(std::uint64_t handle) {
void file_manager::close_all(const std::string &api_path) {
recur_mutex_lock file_lock(open_file_mtx_);
std::vector<std::uint64_t> handles;
auto it = open_file_lookup_.find(api_path);
if (it != open_file_lookup_.end()) {
handles = it->second->get_handles();
auto iter = open_file_lookup_.find(api_path);
if (iter != open_file_lookup_.end()) {
handles = iter->second->get_handles();
}
for (auto &handle : handles) {