Skip to content

Commit 6300236

Browse files
authored
cleanup TypedIndexPointIter & ditch Direct variant (#4654)
# Description of Changes Ditches `TypedIndexPointIter::Direct` and then does some renaming of variants in `TypedIndexPointIter` to reflect reality. Extracted from #4311. # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing Covered by existing tests.
1 parent 5287252 commit 6300236

6 files changed

Lines changed: 118 additions & 127 deletions

File tree

crates/table/proptest-regressions/table_index/mod.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
# everyone who runs the test benefits from these saved cases.
77
cc 3276d3db4a1a70d78db9a6a01eaa3bba810a2317e9c67e4d5d8d93cbba472c99 # shrinks to ((ty, cols, pv), is_unique) = ((ProductType {None: Bool}, [ColId(0)], ProductValue { elements: [Bool(false)] }), false)
88
cc bc80b80ac2390452c0a152d2c6e2abc29ce146642f3cd0fe136ffe6173cf4c8c # shrinks to (ty, cols, pv) = (ProductType {None: I64}, [ColId(0)], ProductValue { elements: [I64(0)] }), kind = Direct
9+
cc c1e4c959a32f6ab8ef9c4e29d39a24ec47cb03524584606a7f1fa4563f0f8cca # shrinks to (ty, cols, pv) = (ProductType {None: Sum(SumType {"variant_0": Product(ProductType {})})}, [ColId(0)], ProductValue { elements: [Sum(SumValue { tag: 0, value: Product(ProductValue { elements: [] }) })] }), kind = Direct

crates/table/src/table_index/mod.rs

Lines changed: 84 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
use self::hash_index::HashIndex;
2828
use self::same_key_entry::SameKeyEntryIter;
2929
use self::unique_direct_fixed_cap_index::{UniqueDirectFixedCapIndex, UniqueDirectFixedCapIndexRangeIter};
30-
use self::unique_direct_index::{UniqueDirectIndex, UniqueDirectIndexPointIter, UniqueDirectIndexRangeIter};
30+
use self::unique_direct_index::{UniqueDirectIndex, UniqueDirectIndexRangeIter};
3131
use self::unique_hash_index::UniqueHashIndex;
3232
use super::indexes::RowPointer;
3333
use super::table::RowRef;
@@ -58,28 +58,24 @@ pub use self::index::{Index, IndexCannotSeekRange, IndexSeekRangeResult, RangedI
5858
pub use self::key_size::KeySize;
5959

6060
type BtreeIndex<K> = multimap::MultiMap<K>;
61-
type BtreeIndexPointIter<'a> = SameKeyEntryIter<'a>;
6261
type BtreeIndexRangeIter<'a, K> = multimap::MultiMapRangeIter<'a, K>;
6362
type BtreeUniqueIndex<K> = uniquemap::UniqueMap<K>;
64-
type BtreeUniqueIndexPointIter<'a> = uniquemap::UniqueMapPointIter<'a>;
6563
type BtreeUniqueIndexRangeIter<'a, K> = uniquemap::UniqueMapRangeIter<'a, K>;
6664

6765
/// A point iterator over a [`TypedIndex`], with a specialized key type.
6866
///
6967
/// See module docs for info about specialization.
7068
enum TypedIndexPointIter<'a> {
71-
BTree(BtreeIndexPointIter<'a>),
72-
UniqueBTree(BtreeUniqueIndexPointIter<'a>),
73-
UniqueDirect(UniqueDirectIndexPointIter),
69+
NonUnique(SameKeyEntryIter<'a>),
70+
Unique(uniquemap::UniquePointIter),
7471
}
7572

7673
impl Iterator for TypedIndexPointIter<'_> {
7774
type Item = RowPointer;
7875
fn next(&mut self) -> Option<Self::Item> {
7976
match self {
80-
Self::BTree(this) => this.next(),
81-
Self::UniqueBTree(this) => this.next(),
82-
Self::UniqueDirect(this) => this.next(),
77+
Self::NonUnique(this) => this.next(),
78+
Self::Unique(this) => this.next(),
8379
}
8480
}
8581
}
@@ -961,85 +957,85 @@ impl TypedIndex {
961957
use TypedIndex::*;
962958
use TypedIndexPointIter::*;
963959
match self {
964-
BtreeBool(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_bool)),
965-
BtreeU8(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u8)),
966-
BtreeSumTag(this) => BTree(iter_at_type(this, key, as_sum_tag)),
967-
BtreeI8(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i8)),
968-
BtreeU16(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u16)),
969-
BtreeI16(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i16)),
970-
BtreeU32(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u32)),
971-
BtreeI32(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i32)),
972-
BtreeU64(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u64)),
973-
BtreeI64(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i64)),
974-
BtreeU128(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u128)),
975-
BtreeI128(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i128)),
976-
BtreeU256(this) => BTree(iter_at_type(this, key, |av| av.as_u256().map(|x| &**x))),
977-
BtreeI256(this) => BTree(iter_at_type(this, key, |av| av.as_i256().map(|x| &**x))),
978-
BtreeF32(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_f32)),
979-
BtreeF64(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_f64)),
980-
BtreeString(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_string)),
981-
BtreeAV(this) => BTree(this.seek_point(key)),
982-
HashBool(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_bool)),
983-
HashU8(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u8)),
984-
HashSumTag(this) => BTree(iter_at_type(this, key, as_sum_tag)),
985-
HashI8(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i8)),
986-
HashU16(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u16)),
987-
HashI16(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i16)),
988-
HashU32(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u32)),
989-
HashI32(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i32)),
990-
HashU64(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u64)),
991-
HashI64(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i64)),
992-
HashU128(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_u128)),
993-
HashI128(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_i128)),
994-
HashU256(this) => BTree(iter_at_type(this, key, |av| av.as_u256().map(|x| &**x))),
995-
HashI256(this) => BTree(iter_at_type(this, key, |av| av.as_i256().map(|x| &**x))),
996-
HashF32(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_f32)),
997-
HashF64(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_f64)),
998-
HashString(this) => BTree(iter_at_type(this, key, AlgebraicValue::as_string)),
999-
HashAV(this) => BTree(this.seek_point(key)),
1000-
UniqueBtreeBool(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_bool)),
1001-
UniqueBtreeU8(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u8)),
1002-
UniqueBtreeSumTag(this) => UniqueBTree(iter_at_type(this, key, as_sum_tag)),
1003-
UniqueBtreeI8(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i8)),
1004-
UniqueBtreeU16(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u16)),
1005-
UniqueBtreeI16(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i16)),
1006-
UniqueBtreeU32(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u32)),
1007-
UniqueBtreeI32(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i32)),
1008-
UniqueBtreeU64(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u64)),
1009-
UniqueBtreeI64(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i64)),
1010-
UniqueBtreeU128(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u128)),
1011-
UniqueBtreeI128(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i128)),
1012-
UniqueBtreeU256(this) => UniqueBTree(iter_at_type(this, key, |av| av.as_u256().map(|x| &**x))),
1013-
UniqueBtreeI256(this) => UniqueBTree(iter_at_type(this, key, |av| av.as_i256().map(|x| &**x))),
1014-
UniqueBtreeF32(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_f32)),
1015-
UniqueBtreeF64(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_f64)),
1016-
UniqueBtreeString(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_string)),
1017-
UniqueBtreeAV(this) => UniqueBTree(this.seek_point(key)),
1018-
1019-
UniqueHashBool(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_bool)),
1020-
UniqueHashU8(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u8)),
1021-
UniqueHashSumTag(this) => UniqueBTree(iter_at_type(this, key, as_sum_tag)),
1022-
UniqueHashI8(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i8)),
1023-
UniqueHashU16(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u16)),
1024-
UniqueHashI16(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i16)),
1025-
UniqueHashU32(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u32)),
1026-
UniqueHashI32(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i32)),
1027-
UniqueHashU64(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u64)),
1028-
UniqueHashI64(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i64)),
1029-
UniqueHashU128(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_u128)),
1030-
UniqueHashI128(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_i128)),
1031-
UniqueHashU256(this) => UniqueBTree(iter_at_type(this, key, |av| av.as_u256().map(|x| &**x))),
1032-
UniqueHashI256(this) => UniqueBTree(iter_at_type(this, key, |av| av.as_i256().map(|x| &**x))),
1033-
UniqueHashF32(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_f32)),
1034-
UniqueHashF64(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_f64)),
1035-
UniqueHashString(this) => UniqueBTree(iter_at_type(this, key, AlgebraicValue::as_string)),
1036-
UniqueHashAV(this) => UniqueBTree(this.seek_point(key)),
1037-
1038-
UniqueDirectSumTag(this) => UniqueDirect(iter_at_type(this, key, as_sum_tag)),
1039-
UniqueDirectU8(this) => UniqueDirect(iter_at_type(this, key, AlgebraicValue::as_u8)),
1040-
UniqueDirectU16(this) => UniqueDirect(iter_at_type(this, key, AlgebraicValue::as_u16)),
1041-
UniqueDirectU32(this) => UniqueDirect(iter_at_type(this, key, AlgebraicValue::as_u32)),
1042-
UniqueDirectU64(this) => UniqueDirect(iter_at_type(this, key, AlgebraicValue::as_u64)),
960+
BtreeBool(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_bool)),
961+
BtreeU8(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u8)),
962+
BtreeSumTag(this) => NonUnique(iter_at_type(this, key, as_sum_tag)),
963+
BtreeI8(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i8)),
964+
BtreeU16(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u16)),
965+
BtreeI16(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i16)),
966+
BtreeU32(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u32)),
967+
BtreeI32(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i32)),
968+
BtreeU64(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u64)),
969+
BtreeI64(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i64)),
970+
BtreeU128(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u128)),
971+
BtreeI128(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i128)),
972+
BtreeU256(this) => NonUnique(iter_at_type(this, key, |av| av.as_u256().map(|x| &**x))),
973+
BtreeI256(this) => NonUnique(iter_at_type(this, key, |av| av.as_i256().map(|x| &**x))),
974+
BtreeF32(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_f32)),
975+
BtreeF64(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_f64)),
976+
BtreeString(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_string)),
977+
BtreeAV(this) => NonUnique(this.seek_point(key)),
978+
HashBool(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_bool)),
979+
HashU8(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u8)),
980+
HashSumTag(this) => NonUnique(iter_at_type(this, key, as_sum_tag)),
981+
HashI8(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i8)),
982+
HashU16(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u16)),
983+
HashI16(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i16)),
984+
HashU32(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u32)),
985+
HashI32(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i32)),
986+
HashU64(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u64)),
987+
HashI64(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i64)),
988+
HashU128(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_u128)),
989+
HashI128(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_i128)),
990+
HashU256(this) => NonUnique(iter_at_type(this, key, |av| av.as_u256().map(|x| &**x))),
991+
HashI256(this) => NonUnique(iter_at_type(this, key, |av| av.as_i256().map(|x| &**x))),
992+
HashF32(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_f32)),
993+
HashF64(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_f64)),
994+
HashString(this) => NonUnique(iter_at_type(this, key, AlgebraicValue::as_string)),
995+
HashAV(this) => NonUnique(this.seek_point(key)),
996+
UniqueBtreeBool(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_bool)),
997+
UniqueBtreeU8(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u8)),
998+
UniqueBtreeSumTag(this) => Unique(iter_at_type(this, key, as_sum_tag)),
999+
UniqueBtreeI8(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i8)),
1000+
UniqueBtreeU16(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u16)),
1001+
UniqueBtreeI16(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i16)),
1002+
UniqueBtreeU32(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u32)),
1003+
UniqueBtreeI32(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i32)),
1004+
UniqueBtreeU64(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u64)),
1005+
UniqueBtreeI64(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i64)),
1006+
UniqueBtreeU128(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u128)),
1007+
UniqueBtreeI128(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i128)),
1008+
UniqueBtreeU256(this) => Unique(iter_at_type(this, key, |av| av.as_u256().map(|x| &**x))),
1009+
UniqueBtreeI256(this) => Unique(iter_at_type(this, key, |av| av.as_i256().map(|x| &**x))),
1010+
UniqueBtreeF32(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_f32)),
1011+
UniqueBtreeF64(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_f64)),
1012+
UniqueBtreeString(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_string)),
1013+
UniqueBtreeAV(this) => Unique(this.seek_point(key)),
1014+
1015+
UniqueHashBool(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_bool)),
1016+
UniqueHashU8(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u8)),
1017+
UniqueHashSumTag(this) => Unique(iter_at_type(this, key, as_sum_tag)),
1018+
UniqueHashI8(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i8)),
1019+
UniqueHashU16(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u16)),
1020+
UniqueHashI16(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i16)),
1021+
UniqueHashU32(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u32)),
1022+
UniqueHashI32(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i32)),
1023+
UniqueHashU64(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u64)),
1024+
UniqueHashI64(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i64)),
1025+
UniqueHashU128(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u128)),
1026+
UniqueHashI128(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_i128)),
1027+
UniqueHashU256(this) => Unique(iter_at_type(this, key, |av| av.as_u256().map(|x| &**x))),
1028+
UniqueHashI256(this) => Unique(iter_at_type(this, key, |av| av.as_i256().map(|x| &**x))),
1029+
UniqueHashF32(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_f32)),
1030+
UniqueHashF64(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_f64)),
1031+
UniqueHashString(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_string)),
1032+
UniqueHashAV(this) => Unique(this.seek_point(key)),
1033+
1034+
UniqueDirectSumTag(this) => Unique(iter_at_type(this, key, as_sum_tag)),
1035+
UniqueDirectU8(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u8)),
1036+
UniqueDirectU16(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u16)),
1037+
UniqueDirectU32(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u32)),
1038+
UniqueDirectU64(this) => Unique(iter_at_type(this, key, AlgebraicValue::as_u64)),
10431039
}
10441040
}
10451041

crates/table/src/table_index/unique_direct_fixed_cap_index.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use super::index::{Index, RangedIndex};
2-
use super::unique_direct_index::{expose, injest, ToFromUsize, UniqueDirectIndexPointIter, NONE_PTR};
2+
use super::unique_direct_index::{expose, injest, ToFromUsize, NONE_PTR};
3+
use super::uniquemap::UniquePointIter;
34
use crate::indexes::RowPointer;
45
use crate::table_index::KeySize;
56
use core::marker::PhantomData;
@@ -79,13 +80,18 @@ impl<K: ToFromUsize + KeySize> Index for UniqueDirectFixedCapIndex<K> {
7980
}
8081

8182
type PointIter<'a>
82-
= UniqueDirectIndexPointIter
83+
= UniquePointIter
8384
where
8485
Self: 'a;
8586

8687
fn seek_point(&self, &key: &Self::Key) -> Self::PointIter<'_> {
87-
let point = self.array.get(key.to_usize()).copied().filter(|slot| *slot != NONE_PTR);
88-
UniqueDirectIndexPointIter::new(point)
88+
let point = self
89+
.array
90+
.get(key.to_usize())
91+
.copied()
92+
.filter(|slot| *slot != NONE_PTR)
93+
.map(expose);
94+
UniquePointIter::new(point)
8995
}
9096

9197
fn num_keys(&self) -> usize {

crates/table/src/table_index/unique_direct_index.rs

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use super::index::{Despecialize, Index, RangedIndex};
2+
use super::uniquemap::UniquePointIter;
23
use super::{BtreeUniqueIndex, KeySize};
34
use crate::indexes::{PageIndex, PageOffset, RowPointer, SquashedOffset};
45
use core::marker::PhantomData;
56
use core::mem;
67
use core::ops::{Bound, RangeBounds};
7-
use core::option::IntoIter;
88
use spacetimedb_sats::memory_usage::MemoryUsage;
99
use spacetimedb_sats::sum_value::SumTag;
1010

@@ -226,7 +226,7 @@ impl<K: ToFromUsize + KeySize> Index for UniqueDirectIndex<K> {
226226
}
227227

228228
type PointIter<'a>
229-
= UniqueDirectIndexPointIter
229+
= UniquePointIter
230230
where
231231
Self: 'a;
232232

@@ -238,8 +238,9 @@ impl<K: ToFromUsize + KeySize> Index for UniqueDirectIndex<K> {
238238
.get(outer_key)
239239
.and_then(|x| x.as_ref())
240240
.map(|inner| inner.get(inner_key))
241-
.filter(|slot| *slot != NONE_PTR);
242-
UniqueDirectIndexPointIter::new(point)
241+
.filter(|slot| *slot != NONE_PTR)
242+
.map(expose);
243+
UniquePointIter::new(point)
243244
}
244245

245246
fn num_keys(&self) -> usize {
@@ -315,25 +316,6 @@ impl<K: ToFromUsize + KeySize> RangedIndex for UniqueDirectIndex<K> {
315316
}
316317
}
317318

318-
/// An iterator over the potential value in a [`UniqueDirectMap`] for a given key.
319-
pub struct UniqueDirectIndexPointIter {
320-
iter: IntoIter<RowPointer>,
321-
}
322-
323-
impl UniqueDirectIndexPointIter {
324-
pub(super) fn new(point: Option<RowPointer>) -> Self {
325-
let iter = point.map(expose).into_iter();
326-
Self { iter }
327-
}
328-
}
329-
330-
impl Iterator for UniqueDirectIndexPointIter {
331-
type Item = RowPointer;
332-
fn next(&mut self) -> Option<Self::Item> {
333-
self.iter.next()
334-
}
335-
}
336-
337319
/// An iterator over a range of keys in a [`UniqueDirectIndex`].
338320
#[derive(Debug, Clone)]
339321
pub struct UniqueDirectIndexRangeIter<'a> {

0 commit comments

Comments
 (0)