Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Dandandan committed Dec 22, 2021
1 parent 976c03a commit 595c07b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arrow/src/compute/kernels/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@ where
let mut result = BooleanBufferBuilder::new(left.len());
for i in 0..left.len() {
let haystack = left.value(i);
let pat = escape(right.value(i));
let re = if let Some(ref regex) = map.get(&pat) {
let pat = right.value(i);
let re = if let Some(ref regex) = map.get(pat) {
regex
} else {
let re_pattern = pat.replace("%", ".*").replace("_", ".");
let re_pattern = escape(pat).replace("%", ".*").replace("_", ".");
let re = op(&re_pattern)?;
map.insert(pat.clone(), re);
map.get(&pat).unwrap()
map.insert(pat, re);
map.get(pat).unwrap()
};

result.append(if negate_regex {
Expand Down

0 comments on commit 595c07b

Please sign in to comment.