Switch order of MappedInterner generic params

This commit is contained in:
Loïc Lecrenier
2023-03-20 09:37:11 +01:00
parent 9259cdb12e
commit c63c7377e6
8 changed files with 21 additions and 21 deletions

View File

@ -14,7 +14,7 @@ impl<G: RankingRuleGraphTrait> RankingRuleGraph<G> {
&mut self,
from: Interned<QueryNode>,
cost: u16,
all_distances: &MappedInterner<Vec<u16>, QueryNode>,
all_distances: &MappedInterner<QueryNode, Vec<u16>>,
dead_ends_cache: &mut DeadEndsCache<G::Condition>,
mut visit: impl FnMut(
&[Interned<G::Condition>],
@ -38,7 +38,7 @@ impl<G: RankingRuleGraphTrait> RankingRuleGraph<G> {
&mut self,
from: Interned<QueryNode>,
cost: u16,
all_distances: &MappedInterner<Vec<u16>, QueryNode>,
all_distances: &MappedInterner<QueryNode, Vec<u16>>,
dead_ends_cache: &mut DeadEndsCache<G::Condition>,
visit: &mut impl FnMut(
&[Interned<G::Condition>],
@ -137,7 +137,7 @@ impl<G: RankingRuleGraphTrait> RankingRuleGraph<G> {
Ok(any_valid)
}
pub fn initialize_distances_with_necessary_edges(&self) -> MappedInterner<Vec<u16>, QueryNode> {
pub fn initialize_distances_with_necessary_edges(&self) -> MappedInterner<QueryNode, Vec<u16>> {
let mut distances_to_end = self.query_graph.nodes.map(|_| vec![]);
let mut enqueued = SmallBitmap::new(self.query_graph.nodes.len());

View File

@ -114,7 +114,7 @@ pub trait RankingRuleGraphTrait: Sized {
paths: &[Vec<Interned<Self::Condition>>],
dead_ends_cache: &DeadEndsCache<Self::Condition>,
universe: &RoaringBitmap,
distances: &MappedInterner<Vec<u16>, QueryNode>,
distances: &MappedInterner<QueryNode, Vec<u16>>,
cost: u16,
logger: &mut dyn SearchLogger<QueryGraph>,
);
@ -127,7 +127,7 @@ pub trait RankingRuleGraphTrait: Sized {
pub struct RankingRuleGraph<G: RankingRuleGraphTrait> {
pub query_graph: QueryGraph,
pub edges_store: FixedSizeInterner<Option<Edge<G::Condition>>>,
pub edges_of_node: MappedInterner<SmallBitmap<Option<Edge<G::Condition>>>, QueryNode>,
pub edges_of_node: MappedInterner<QueryNode, SmallBitmap<Option<Edge<G::Condition>>>>,
pub conditions_interner: FixedSizeInterner<G::Condition>,
}
impl<G: RankingRuleGraphTrait> Clone for RankingRuleGraph<G> {

View File

@ -67,7 +67,7 @@ impl RankingRuleGraphTrait for ProximityGraph {
paths: &[Vec<Interned<ProximityCondition>>],
dead_ends_cache: &DeadEndsCache<Self::Condition>,
universe: &RoaringBitmap,
distances: &MappedInterner<Vec<u16>, QueryNode>,
distances: &MappedInterner<QueryNode, Vec<u16>>,
cost: u16,
logger: &mut dyn SearchLogger<QueryGraph>,
) {

View File

@ -138,7 +138,7 @@ impl RankingRuleGraphTrait for TypoGraph {
paths: &[Vec<Interned<TypoCondition>>],
dead_ends_cache: &DeadEndsCache<TypoCondition>,
universe: &RoaringBitmap,
distances: &MappedInterner<Vec<u16>, QueryNode>,
distances: &MappedInterner<QueryNode, Vec<u16>>,
cost: u16,
logger: &mut dyn SearchLogger<QueryGraph>,
) {