summaryrefslogtreecommitdiff
path: root/src/collection/boxed.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/collection/boxed.rs')
-rw-r--r--src/collection/boxed.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/collection/boxed.rs b/src/collection/boxed.rs
index 1f068ec..f8e0fb8 100644
--- a/src/collection/boxed.rs
+++ b/src/collection/boxed.rs
@@ -11,6 +11,10 @@ use super::{utils, BoxedLockCollection, LockGuard};
/// returns `true` if the sorted list contains a duplicate
#[must_use]
fn contains_duplicates(l: &[&dyn RawLock]) -> bool {
+ if l.is_empty() {
+ return false;
+ }
+
l.windows(2)
.any(|window| std::ptr::eq(window[0], window[1]))
}