From 608e08f8adbe7bd37a751bc493bdf38ed84a5517 Mon Sep 17 00:00:00 2001 From: frank400 Date: Mon, 3 May 2021 09:50:35 -0300 Subject: [PATCH] Optimize holder constructor call --- cpp/src/gandiva/like_holder.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cpp/src/gandiva/like_holder.cc b/cpp/src/gandiva/like_holder.cc index a2309d57dc161..d02c166700175 100644 --- a/cpp/src/gandiva/like_holder.cc +++ b/cpp/src/gandiva/like_holder.cc @@ -96,11 +96,7 @@ Status LikeHolder::Make(const std::string& sql_pattern, ARROW_RETURN_NOT_OK(RegexUtil::SqlLikePatternToPcre(sql_pattern, pcre_pattern)); std::shared_ptr lholder; - if (regex_op.case_sensitive()) { - lholder = std::shared_ptr(new LikeHolder(pcre_pattern)); - } else { - lholder = std::shared_ptr(new LikeHolder(pcre_pattern, regex_op)); - } + lholder = std::shared_ptr(new LikeHolder(pcre_pattern, regex_op)); ARROW_RETURN_IF(!lholder->regex_.ok(), Status::Invalid("Building RE2 pattern '", pcre_pattern, "' failed"));