From 2031e0afaf6d5501da1d6fca51df240e2465961f Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Fri, 19 Aug 2022 12:40:42 -0500 Subject: [PATCH] simple refactorings to disk idx (#27238) --- runtime/src/accounts_index.rs | 3 ++- runtime/src/bucket_map_holder.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index a2bd30d35d..386367e005 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -412,7 +412,8 @@ impl PreAllocatedAccountMapEntry { account_info: T, storage: &Arc>, ) -> AccountMapEntry { - let ref_count = if account_info.is_cached() { 0 } else { 1 }; + let is_cached = account_info.is_cached(); + let ref_count = if is_cached { 0 } else { 1 }; let meta = AccountMapEntryMeta::new_dirty(storage); Arc::new(AccountMapEntryInner::new( vec![(slot, account_info)], diff --git a/runtime/src/bucket_map_holder.rs b/runtime/src/bucket_map_holder.rs index b0237c5910..aea586dca6 100644 --- a/runtime/src/bucket_map_holder.rs +++ b/runtime/src/bucket_map_holder.rs @@ -31,6 +31,7 @@ pub struct BucketMapHolder { pub disk: Option>, pub count_buckets_flushed: AtomicUsize, + /// rolling 'current' age pub age: AtomicU8, pub stats: BucketMapHolderStats,