mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
Avoid cloning FilterCondition in filter array parsing
This commit is contained in:
parent
8a271223a9
commit
9b6602cba2
@ -104,7 +104,7 @@ impl<'a> Filter<'a> {
|
|||||||
if ors.len() > 1 {
|
if ors.len() > 1 {
|
||||||
ands.push(FilterCondition::Or(ors));
|
ands.push(FilterCondition::Or(ors));
|
||||||
} else if ors.len() == 1 {
|
} else if ors.len() == 1 {
|
||||||
ands.push(ors[0].clone());
|
ands.push(ors.pop().unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Either::Right(rule) => {
|
Either::Right(rule) => {
|
||||||
@ -117,7 +117,7 @@ impl<'a> Filter<'a> {
|
|||||||
let and = if ands.is_empty() {
|
let and = if ands.is_empty() {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
} else if ands.len() == 1 {
|
} else if ands.len() == 1 {
|
||||||
ands[0].clone()
|
ands.pop().unwrap()
|
||||||
} else {
|
} else {
|
||||||
FilterCondition::And(ands)
|
FilterCondition::And(ands)
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user