Skip to content

Commit

Permalink
Optimize holder constructor call
Browse files Browse the repository at this point in the history
  • Loading branch information
jvictorhuguenin committed Jun 7, 2021
1 parent 97e6e2d commit f160880
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cpp/src/gandiva/like_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<LikeHolder> lholder;
if (regex_op.case_sensitive()) {
lholder = std::shared_ptr<LikeHolder>(new LikeHolder(pcre_pattern));
} else {
lholder = std::shared_ptr<LikeHolder>(new LikeHolder(pcre_pattern, regex_op));
}
lholder = std::shared_ptr<LikeHolder>(new LikeHolder(pcre_pattern, regex_op));

ARROW_RETURN_IF(!lholder->regex_.ok(),
Status::Invalid("Building RE2 pattern '", pcre_pattern, "' failed"));
Expand Down

0 comments on commit f160880

Please sign in to comment.