|
1 | 1 | //! A lock-free skip list. See [`SkipList`].
|
2 | 2 |
|
3 |
| -use crate::comparator::{Comparator, OrdComparator}; |
| 3 | +use crate::comparator::{Comparator, BasicComparator}; |
4 | 4 |
|
5 | 5 | use alloc::alloc::{alloc, dealloc, handle_alloc_error, Layout};
|
6 | 6 | use core::cmp;
|
@@ -323,7 +323,7 @@ struct HotData {
|
323 | 323 | // As a further future optimization, if `!mem::needs_drop::<K>() && !mem::needs_drop::<V>()`
|
324 | 324 | // (neither key nor the value have destructors), there's no point in creating a new local
|
325 | 325 | // collector, so we should simply use the global one.
|
326 |
| -pub struct SkipList<K, V, C = OrdComparator> { |
| 326 | +pub struct SkipList<K, V, C = BasicComparator> { |
327 | 327 | /// The head of the skip list (just a dummy node, not a real entry).
|
328 | 328 | head: Head<K, V>,
|
329 | 329 |
|
@@ -1333,7 +1333,7 @@ impl<K, V, C> IntoIterator for SkipList<K, V, C> {
|
1333 | 1333 | /// The lifetimes of the key and value are the same as that of the `Guard`
|
1334 | 1334 | /// used when creating the `Entry` (`'g`). This lifetime is also constrained to
|
1335 | 1335 | /// not outlive the `SkipList`.
|
1336 |
| -pub struct Entry<'a: 'g, 'g, K, V, C = OrdComparator> { |
| 1336 | +pub struct Entry<'a: 'g, 'g, K, V, C = BasicComparator> { |
1337 | 1337 | parent: &'a SkipList<K, V, C>,
|
1338 | 1338 | node: &'g Node<K, V>,
|
1339 | 1339 | guard: &'g Guard,
|
@@ -1476,7 +1476,7 @@ where
|
1476 | 1476 | ///
|
1477 | 1477 | /// You *must* call `release` to free this type, otherwise the node will be
|
1478 | 1478 | /// leaked. This is because releasing the entry requires a `Guard`.
|
1479 |
| -pub struct RefEntry<'a, K, V, C = OrdComparator> { |
| 1479 | +pub struct RefEntry<'a, K, V, C = BasicComparator> { |
1480 | 1480 | parent: &'a SkipList<K, V, C>,
|
1481 | 1481 | node: &'a Node<K, V>,
|
1482 | 1482 | }
|
@@ -1651,7 +1651,7 @@ where
|
1651 | 1651 | }
|
1652 | 1652 |
|
1653 | 1653 | /// An iterator over the entries of a `SkipList`.
|
1654 |
| -pub struct Iter<'a: 'g, 'g, K, V, C = OrdComparator> { |
| 1654 | +pub struct Iter<'a: 'g, 'g, K, V, C = BasicComparator> { |
1655 | 1655 | parent: &'a SkipList<K, V, C>,
|
1656 | 1656 | head: Option<&'g Node<K, V>>,
|
1657 | 1657 | tail: Option<&'g Node<K, V>>,
|
@@ -1728,7 +1728,7 @@ where
|
1728 | 1728 | }
|
1729 | 1729 |
|
1730 | 1730 | /// An iterator over reference-counted entries of a `SkipList`.
|
1731 |
| -pub struct RefIter<'a, K, V, C = OrdComparator> { |
| 1731 | +pub struct RefIter<'a, K, V, C = BasicComparator> { |
1732 | 1732 | parent: &'a SkipList<K, V, C>,
|
1733 | 1733 | head: Option<RefEntry<'a, K, V, C>>,
|
1734 | 1734 | tail: Option<RefEntry<'a, K, V, C>>,
|
@@ -1830,7 +1830,7 @@ impl<'a, K: 'a, V: 'a, C> RefIter<'a, K, V, C> {
|
1830 | 1830 | }
|
1831 | 1831 |
|
1832 | 1832 | /// An iterator over a subset of entries of a `SkipList`.
|
1833 |
| -pub struct Range<'a: 'g, 'g, Q, R, K, V, C = OrdComparator> |
| 1833 | +pub struct Range<'a: 'g, 'g, Q, R, K, V, C = BasicComparator> |
1834 | 1834 | where
|
1835 | 1835 | C: Comparator<K> + Comparator<K, Q>,
|
1836 | 1836 | R: RangeBounds<Q>,
|
@@ -1946,7 +1946,7 @@ where
|
1946 | 1946 | }
|
1947 | 1947 |
|
1948 | 1948 | /// An iterator over reference-counted subset of entries of a `SkipList`.
|
1949 |
| -pub struct RefRange<'a, Q, R, K, V, C = OrdComparator> |
| 1949 | +pub struct RefRange<'a, Q, R, K, V, C = BasicComparator> |
1950 | 1950 | where
|
1951 | 1951 | C: Comparator<K> + Comparator<K, Q>,
|
1952 | 1952 | R: RangeBounds<Q>,
|
|
0 commit comments