Skip to content

Commit

Permalink
Update Build to use HashSet
Browse files Browse the repository at this point in the history
This should operate faster than the BTreeSet used previously
  • Loading branch information
phillord committed Jun 24, 2024
1 parent 492d6af commit 18aa36c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
use std::borrow::Borrow;
use std::cell::RefCell;
use std::cmp::Ordering;
use std::collections::BTreeSet;
use std::collections::{BTreeSet, HashSet};
use std::convert::{TryFrom, TryInto};
use std::fmt::Debug;
use std::fmt::Display;
Expand Down Expand Up @@ -271,13 +271,13 @@ impl<A: ForIRI> IRI<A> {
/// without consequences except for increased memory use.
#[derive(Debug, Default)]
pub struct Build<A: ForIRI>(
RefCell<BTreeSet<IRI<A>>>,
RefCell<BTreeSet<AnonymousIndividual<A>>>,
RefCell<HashSet<IRI<A>>>,
RefCell<HashSet<AnonymousIndividual<A>>>,
);

impl<A: ForIRI> Build<A> {
pub fn new() -> Build<A> {
Build(RefCell::new(BTreeSet::new()), RefCell::new(BTreeSet::new()))
Build(Default::default(), Default::default())
}

/// Constructs a new `AnonymousIndividual`
Expand Down

0 comments on commit 18aa36c

Please sign in to comment.