This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 5230478b53c [improvement](executor) improve readability and efficiency of the checks (#29696) 5230478b53c is described below commit 5230478b53cbe98265ae16532e9c6c6951aaba3d Author: xy <whuxingy...@163.com> AuthorDate: Tue Jan 9 14:54:44 2024 +0800 [improvement](executor) improve readability and efficiency of the checks (#29696) Co-authored-by: xingying01 <xingyin...@corp.netease.com> --- be/src/runtime/task_group/task_group_manager.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/be/src/runtime/task_group/task_group_manager.cpp b/be/src/runtime/task_group/task_group_manager.cpp index 98043c6395a..cbd7b5f73f6 100644 --- a/be/src/runtime/task_group/task_group_manager.cpp +++ b/be/src/runtime/task_group/task_group_manager.cpp @@ -69,18 +69,16 @@ TaskGroupPtr TaskGroupManager::get_task_group_by_id(uint64_t tg_id) { bool TaskGroupManager::set_cg_task_sche_for_query_ctx(uint64_t tg_id, QueryContext* query_ctx_ptr) { std::lock_guard<std::shared_mutex> write_lock(_task_scheduler_lock); - if (_tg_sche_map.find(tg_id) != _tg_sche_map.end()) { - query_ctx_ptr->set_task_scheduler(_tg_sche_map.at(tg_id).get()); - } else { - return false; - } - - if (_tg_scan_sche_map.find(tg_id) != _tg_scan_sche_map.end()) { - query_ctx_ptr->set_scan_task_scheduler(_tg_scan_sche_map.at(tg_id).get()); - } else { - return false; + auto tg_sche_it = _tg_sche_map.find(tg_id); + if (tg_sche_it != _tg_sche_map.end()) { + query_ctx_ptr->set_task_scheduler(tg_sche_it->second.get()); + auto _tg_scan_sche_it = _tg_scan_sche_map.find(tg_id); + if (_tg_scan_sche_it != _tg_scan_sche_map.end()) { + query_ctx_ptr->set_scan_task_scheduler(_tg_scan_sche_it->second.get()); + return true; + } } - return true; + return false; } Status TaskGroupManager::upsert_cg_task_scheduler(taskgroup::TaskGroupInfo* tg_info, --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org