regain determinism

This commit is contained in:
Eh2406 2018-12-01 10:04:03 -05:00
parent 8c7f6af4e8
commit 3bd1005c0d

View File

@ -11,7 +11,7 @@ enum ConflictStoreTrie {
Leaf(BTreeMap<PackageId, ConflictReason>), Leaf(BTreeMap<PackageId, ConflictReason>),
/// a Node is a map from an element to a subTrie where /// a Node is a map from an element to a subTrie where
/// all the Sets in the subTrie contains that element. /// all the Sets in the subTrie contains that element.
Node(HashMap<PackageId, ConflictStoreTrie>), Node(BTreeMap<PackageId, ConflictStoreTrie>),
} }
impl ConflictStoreTrie { impl ConflictStoreTrie {
@ -59,7 +59,7 @@ impl ConflictStoreTrie {
if let Some(pid) = iter.next() { if let Some(pid) = iter.next() {
if let ConflictStoreTrie::Node(p) = self { if let ConflictStoreTrie::Node(p) = self {
p.entry(pid) p.entry(pid)
.or_insert_with(|| ConflictStoreTrie::Node(HashMap::new())) .or_insert_with(|| ConflictStoreTrie::Node(BTreeMap::new()))
.insert(iter, con); .insert(iter, con);
} // else, We already have a subset of this in the ConflictStore } // else, We already have a subset of this in the ConflictStore
} else { } else {
@ -159,7 +159,7 @@ impl ConflictCache {
pub fn insert(&mut self, dep: &Dependency, con: &BTreeMap<PackageId, ConflictReason>) { pub fn insert(&mut self, dep: &Dependency, con: &BTreeMap<PackageId, ConflictReason>) {
self.con_from_dep self.con_from_dep
.entry(dep.clone()) .entry(dep.clone())
.or_insert_with(|| ConflictStoreTrie::Node(HashMap::new())) .or_insert_with(|| ConflictStoreTrie::Node(BTreeMap::new()))
.insert(con.keys().cloned(), con.clone()); .insert(con.keys().cloned(), con.clone());
trace!( trace!(