From 18aa36c3108cb6ba1341bf2946f1e5a7e8b26451 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Mon, 24 Jun 2024 16:27:27 +0100 Subject: [PATCH] Update Build to use HashSet This should operate faster than the BTreeSet used previously --- src/model.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/model.rs b/src/model.rs index b655baa..e2761e1 100644 --- a/src/model.rs +++ b/src/model.rs @@ -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; @@ -271,13 +271,13 @@ impl IRI { /// without consequences except for increased memory use. #[derive(Debug, Default)] pub struct Build( - RefCell>>, - RefCell>>, + RefCell>>, + RefCell>>, ); impl Build { pub fn new() -> Build { - Build(RefCell::new(BTreeSet::new()), RefCell::new(BTreeSet::new())) + Build(Default::default(), Default::default()) } /// Constructs a new `AnonymousIndividual`