solverforge-scoring 0.31.2

Incremental constraint scoring for SolverForge
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::stream::relational::{HandleMap, RowHandle};

#[inline]
pub(super) fn remove_link(
    links: &mut HandleMap<Vec<RowHandle>>,
    input: RowHandle,
    output: RowHandle,
    position: usize,
) -> Option<RowHandle> {
    let bucket = links.get_mut(input)?;
    debug_assert_eq!(bucket[position], output);
    bucket.swap_remove(position);
    let moved = bucket.get(position).copied();
    if bucket.is_empty() {
        links.remove(input);
    }
    moved
}