From a96b41db7a7d429db493b39fd3464656c895be17 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sun, 29 May 2022 23:05:21 +0800 Subject: [PATCH] [Improvement] Simplify expressions for _vconjunct_ctx_ptr (#9816) --- be/src/exec/olap_scan_node.cpp | 4 ++-- be/src/exec/scan_node.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/be/src/exec/olap_scan_node.cpp b/be/src/exec/olap_scan_node.cpp index 1cfb13dd4a..aa3d97edc2 100644 --- a/be/src/exec/olap_scan_node.cpp +++ b/be/src/exec/olap_scan_node.cpp @@ -544,8 +544,8 @@ void OlapScanNode::remove_pushed_conjuncts(RuntimeState* state) { // set vconjunct_ctx is empty, if all conjunct if (_direct_conjunct_size == 0) { - if (_vconjunct_ctx_ptr.get() != nullptr) { - (*_vconjunct_ctx_ptr.get())->close(state); + if (_vconjunct_ctx_ptr != nullptr) { + (*_vconjunct_ctx_ptr)->close(state); _vconjunct_ctx_ptr = nullptr; } } diff --git a/be/src/exec/scan_node.cpp b/be/src/exec/scan_node.cpp index b9b6032375..d7120198e9 100644 --- a/be/src/exec/scan_node.cpp +++ b/be/src/exec/scan_node.cpp @@ -51,20 +51,20 @@ Status ScanNode::prepare(RuntimeState* state) { // Expr tree specific forms do not require requirements. std::string ScanNode::_peel_pushed_vconjunct(RuntimeState* state, const std::function& checker) { - if (_vconjunct_ctx_ptr.get() == nullptr) { + if (_vconjunct_ctx_ptr == nullptr) { return "null"; } int leaf_index = 0; - vectorized::VExpr* conjunct_expr_root = (*_vconjunct_ctx_ptr.get())->root(); + vectorized::VExpr* conjunct_expr_root = (*_vconjunct_ctx_ptr)->root(); if (conjunct_expr_root != nullptr) { vectorized::VExpr* new_conjunct_expr_root = vectorized::VectorizedUtils::dfs_peel_conjunct( - state, *_vconjunct_ctx_ptr.get(), conjunct_expr_root, leaf_index, checker); + state, *_vconjunct_ctx_ptr, conjunct_expr_root, leaf_index, checker); if (new_conjunct_expr_root == nullptr) { - _vconjunct_ctx_ptr = nullptr; + _vconjunct_ctx_ptr.reset(nullptr); } else { - (*_vconjunct_ctx_ptr.get())->set_root(new_conjunct_expr_root); + (*_vconjunct_ctx_ptr)->set_root(new_conjunct_expr_root); return new_conjunct_expr_root->debug_string(); } }