aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-03-08 17:22:37 +0000
committerAria Shrimpton <me@aria.rip>2024-03-08 17:22:37 +0000
commit0b2add103920fe97b9f27f6a3395632b94021b76 (patch)
tree56f1a83b33c968d254e45ed08de1fad28440d33d /src
parent3fa33f01ef15fb774d8f475bca2ed153d837b41f (diff)
use binary search in sorteduniquevec::contains
Diffstat (limited to 'src')
-rw-r--r--src/crates/library/src/sorted_unique_vector.rs2
1 files changed, 1 insertions, 1 deletions
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<T: PartialEq + std::cmp::Ord> SortedUniqueVec<T> {
}
pub fn contains(&self, x: &T) -> bool {
- self.v.contains(x)
+ self.v.binary_search(x).is_ok()
}
pub fn is_empty(&self) -> bool {