fn count_ties_with_ids()

in src/dachshund/node.rs [127:145]


    fn count_ties_with_ids(&self, ids: &HashSet<NodeId>) -> usize {
        let mut num_ties: usize = 0;
        // If we have low degree and we're checking against a big set, iterate through our neighbors
        if self.neighbors.len() <= ids.len() {
            for (neighbor_id, edges) in &self.neighbors {
                if ids.contains(&neighbor_id) {
                    num_ties += edges.len();
                }
            }
        // otherwise iterate through the hashset and check against our neighbors.
        } else {
            for node_id in ids {
                if let Some(edges) = self.neighbors.get(node_id) {
                    num_ties += edges.len()
                }
            }
        };
        num_ties
    }