From 8d34ba9e8c6492f9b6f60e154cceb425c4860afe Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Wed, 19 Oct 2022 20:55:55 +0200 Subject: [PATCH] adhoc_storage_info: Add update(adhoc_storage::ctx) --- src/common/api/internal_types.hpp | 5 +++++ src/scord/adhoc_storage_manager.hpp | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/api/internal_types.hpp b/src/common/api/internal_types.hpp index 0140a62f..7afede19 100644 --- a/src/common/api/internal_types.hpp +++ b/src/common/api/internal_types.hpp @@ -73,6 +73,11 @@ struct adhoc_storage_info { return m_adhoc_storage; } + void + update(admire::adhoc_storage::ctx adhoc_context) { + m_adhoc_storage.update(std::move(adhoc_context)); + } + admire::error_code add_client_info(std::shared_ptr job_info) { diff --git a/src/scord/adhoc_storage_manager.hpp b/src/scord/adhoc_storage_manager.hpp index 78b22ba9..160692ff 100644 --- a/src/scord/adhoc_storage_manager.hpp +++ b/src/scord/adhoc_storage_manager.hpp @@ -75,12 +75,8 @@ struct adhoc_storage_manager : scord::utils::singleton { if(const auto it = m_adhoc_storages.find(id); it != m_adhoc_storages.end()) { - const auto current_adhoc_info = it->second; - auto tmp_adhoc = current_adhoc_info->adhoc_storage(); - tmp_adhoc.update(std::move(new_ctx)); - - *it->second = admire::internal::adhoc_storage_info{tmp_adhoc}; + current_adhoc_info->update(std::move(new_ctx)); return ADM_SUCCESS; } -- GitLab