Replaced some BTreeMaps with HashMaps.

This commit is contained in:
Filipe Rodrigues 2025-02-04 15:38:56 +00:00
parent 2ee5f5796a
commit fe5e7a7dcf
Signed by: zenithsiz
SSH Key Fingerprint: SHA256:Mb5ppb3Sh7IarBO/sBTXLHbYEOz37hJAlslLQPPAPaU

View File

@ -5,7 +5,7 @@ use {
crate::{rules::pattern::Pattern, util::ArcStr, AppError},
itertools::{Itertools, PeekingNext},
smallvec::SmallVec,
std::collections::{BTreeMap, HashMap},
std::collections::HashMap,
};
/// An expression tree.
@ -18,14 +18,14 @@ pub struct ExprTree<K> {
}
// TODO: Flatten this?
type PrefixTree<K> = BTreeMap<ArcStr, SuffixTree<K>>;
type SuffixTree<K> = BTreeMap<ArcStr, (Option<Pattern>, K)>;
type PrefixTree<K> = HashMap<ArcStr, SuffixTree<K>>;
type SuffixTree<K> = HashMap<ArcStr, (Option<Pattern>, K)>;
impl<K> ExprTree<K> {
/// Creates a new, empty, expression tree
pub const fn new() -> Self {
pub fn new() -> Self {
Self {
prefixes: BTreeMap::new(),
prefixes: HashMap::new(),
}
}