rename to items_in_range
This commit is contained in:
committed by
Jeff Washington (jwash)
parent
1649394231
commit
c43c90665e
@ -65,7 +65,7 @@ impl<T: Clone + Copy> Bucket<T> {
|
||||
rv
|
||||
}
|
||||
|
||||
pub fn range<R>(&self, range: Option<&R>) -> Vec<BucketItem<T>>
|
||||
pub fn items_in_range<R>(&self, range: Option<&R>) -> Vec<BucketItem<T>>
|
||||
where
|
||||
R: RangeBounds<Pubkey>,
|
||||
{
|
||||
|
@ -129,11 +129,17 @@ impl<T: Clone + Copy + Debug> BucketMap<T> {
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn range<R>(&self, ix: usize, range: Option<&R>) -> Option<Vec<BucketItem<T>>>
|
||||
pub fn items_in_range<R>(&self, ix: usize, range: Option<&R>) -> Option<Vec<BucketItem<T>>>
|
||||
where
|
||||
R: RangeBounds<Pubkey>,
|
||||
{
|
||||
Some(self.buckets[ix].read().unwrap().as_ref()?.range(range))
|
||||
Some(
|
||||
self.buckets[ix]
|
||||
.read()
|
||||
.unwrap()
|
||||
.as_ref()?
|
||||
.items_in_range(range),
|
||||
)
|
||||
}
|
||||
|
||||
/// Get the Pubkeys for bucket `ix`
|
||||
@ -404,7 +410,7 @@ mod tests {
|
||||
for bin in 0..map.num_buckets() {
|
||||
r.append(
|
||||
&mut map
|
||||
.range(bin, None::<&std::ops::RangeInclusive<Pubkey>>)
|
||||
.items_in_range(bin, None::<&std::ops::RangeInclusive<Pubkey>>)
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user