mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
Address some issues with preallocations
This commit is contained in:
parent
6c9823d7bb
commit
f3fc2bd01f
@ -89,7 +89,7 @@ impl<'a> SearchForFacetValues<'a> {
|
|||||||
|
|
||||||
let fst = match self.search_query.index.facet_id_string_fst.get(rtxn, &fid)? {
|
let fst = match self.search_query.index.facet_id_string_fst.get(rtxn, &fid)? {
|
||||||
Some(fst) => fst,
|
Some(fst) => fst,
|
||||||
None => return Ok(vec![]),
|
None => return Ok(Vec::new()),
|
||||||
};
|
};
|
||||||
|
|
||||||
let search_candidates = self
|
let search_candidates = self
|
||||||
@ -274,11 +274,11 @@ enum ValuesCollection {
|
|||||||
|
|
||||||
impl ValuesCollection {
|
impl ValuesCollection {
|
||||||
pub fn by_lexicographic(max: usize) -> Self {
|
pub fn by_lexicographic(max: usize) -> Self {
|
||||||
ValuesCollection::Lexicographic { max, content: Vec::with_capacity(max) }
|
ValuesCollection::Lexicographic { max, content: Vec::new() }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn by_count(max: usize) -> Self {
|
pub fn by_count(max: usize) -> Self {
|
||||||
ValuesCollection::Count { max, content: BinaryHeap::with_capacity(max) }
|
ValuesCollection::Count { max, content: BinaryHeap::new() }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn insert(&mut self, value: FacetValueHit) -> ControlFlow<()> {
|
pub fn insert(&mut self, value: FacetValueHit) -> ControlFlow<()> {
|
||||||
|
Loading…
Reference in New Issue
Block a user