rename BucketMapKeyValue to BucketItem

This commit is contained in:
Brooks Prumo
2021-09-16 15:13:11 -05:00
committed by Jeff Washington (jwash)
parent fd458abc44
commit 1649394231
2 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
use crate::bucket_map::{BucketMapError, BucketMapKeyValue, MaxSearch, RefCount}; use crate::bucket_map::{BucketItem, BucketMapError, MaxSearch, RefCount};
use crate::data_bucket::{BucketMapStats, DataBucket}; use crate::data_bucket::{BucketMapStats, DataBucket};
use crate::index_entry::IndexEntry; use crate::index_entry::IndexEntry;
use rand::thread_rng; use rand::thread_rng;
@ -65,7 +65,7 @@ impl<T: Clone + Copy> Bucket<T> {
rv rv
} }
pub fn range<R>(&self, range: Option<&R>) -> Vec<BucketMapKeyValue<T>> pub fn range<R>(&self, range: Option<&R>) -> Vec<BucketItem<T>>
where where
R: RangeBounds<Pubkey>, R: RangeBounds<Pubkey>,
{ {
@ -79,7 +79,7 @@ impl<T: Clone + Copy> Bucket<T> {
let key = ix.key; let key = ix.key;
if range.map(|r| r.contains(&key)).unwrap_or(true) { if range.map(|r| r.contains(&key)).unwrap_or(true) {
let val = ix.read_value(self); let val = ix.read_value(self);
result.push(BucketMapKeyValue { result.push(BucketItem {
pubkey: key, pubkey: key,
ref_count: ix.ref_count(), ref_count: ix.ref_count(),
slot_list: val.map(|(v, _ref_count)| v.to_vec()).unwrap_or_default(), slot_list: val.map(|(v, _ref_count)| v.to_vec()).unwrap_or_default(),

View File

@ -16,7 +16,7 @@ pub type MaxSearch = u8;
pub type RefCount = u64; pub type RefCount = u64;
#[derive(Debug, Default, Clone)] #[derive(Debug, Default, Clone)]
pub struct BucketMapKeyValue<T> { pub struct BucketItem<T> {
pub pubkey: Pubkey, pub pubkey: Pubkey,
pub ref_count: RefCount, pub ref_count: RefCount,
pub slot_list: Vec<T>, pub slot_list: Vec<T>,
@ -129,7 +129,7 @@ impl<T: Clone + Copy + Debug> BucketMap<T> {
.unwrap_or_default() .unwrap_or_default()
} }
pub fn range<R>(&self, ix: usize, range: Option<&R>) -> Option<Vec<BucketMapKeyValue<T>>> pub fn range<R>(&self, ix: usize, range: Option<&R>) -> Option<Vec<BucketItem<T>>>
where where
R: RangeBounds<Pubkey>, R: RangeBounds<Pubkey>,
{ {