From 0b2add103920fe97b9f27f6a3395632b94021b76 Mon Sep 17 00:00:00 2001 From: Aria Shrimpton Date: Fri, 8 Mar 2024 17:22:37 +0000 Subject: use binary search in sorteduniquevec::contains --- src/crates/library/src/sorted_unique_vector.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/crates/library/src/sorted_unique_vector.rs b/src/crates/library/src/sorted_unique_vector.rs index cb11ad0..5cb0099 100644 --- a/src/crates/library/src/sorted_unique_vector.rs +++ b/src/crates/library/src/sorted_unique_vector.rs @@ -28,7 +28,7 @@ impl SortedUniqueVec { } pub fn contains(&self, x: &T) -> bool { - self.v.contains(x) + self.v.binary_search(x).is_ok() } pub fn is_empty(&self) -> bool { -- cgit v1.2.3