Skip to content

Commit

Permalink
tiny fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhseh committed Sep 15, 2023
1 parent 2429502 commit bf8f7b0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/expr/src/vector_op/regexp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,10 @@ impl RegexpContext {
fn new(pattern: &str, flags: &str, replacement: &str) -> Result<Self> {
let options = RegexpOptions::from_str(flags)?;

// FIXME: Any better solution?
let mut origin = String::with_capacity(pattern.len());

if options.case_insensitive {
origin.push_str("(?i:");
origin.push_str(pattern);
origin.push(')');
let origin = if options.case_insensitive {
format!("(?i:{})", pattern)
} else {
origin = pattern.to_string();
pattern.to_string()
};

Ok(Self {
Expand Down

0 comments on commit bf8f7b0

Please sign in to comment.