From f160880d215f39411525be66fc9b86c7fafd43c4 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 05e03b51aa8ed..af9ac67d66ac4 100644 --- a/cpp/src/gandiva/like_holder.cc +++ b/cpp/src/gandiva/like_holder.cc @@ -145,11 +145,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"));