Skip to content

Commit

Permalink
Implement ReplaceString with the right type signature
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrv committed Oct 16, 2023
1 parent 732d400 commit bae2dfb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cpp/src/arrow/compute/kernels/scalar_string_ascii.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2063,7 +2063,12 @@ struct RegexSubstringReplacer {
regex_find_("(" + options_.pattern + ")", MakeRE2Options<Type>()),
regex_replacement_(options_.pattern, MakeRE2Options<Type>()) {}

Status ReplaceString(re2::StringPiece s, TypedBufferBuilder<uint8_t>* builder) const {
Status ReplaceString(std::string_view s, TypedBufferBuilder<uint8_t>* builder) const {
re2::StringPiece piece(s.data(), s.length());
return ReplaceStringImpl(piece, builder);
}

Status ReplaceStringImpl(re2::StringPiece s, TypedBufferBuilder<uint8_t>* builder) const {
re2::StringPiece replacement(options_.replacement);

// If s is empty, then it's essentially global
Expand Down

0 comments on commit bae2dfb

Please sign in to comment.