AcctIdx: use stats() accessor (#19890)

This commit is contained in:
Jeff Washington (jwash) 2021-09-15 00:28:44 -05:00 committed by GitHub
parent 691bea8776
commit d3c80be7d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -80,7 +80,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
let m = Measure::start("entry"); let m = Measure::start("entry");
let mut map = self.map().write().unwrap(); let mut map = self.map().write().unwrap();
let entry = map.entry(pubkey); let entry = map.entry(pubkey);
let stats = &self.storage.stats; let stats = &self.stats();
let (count, time) = if matches!(entry, Entry::Occupied(_)) { let (count, time) = if matches!(entry, Entry::Occupied(_)) {
(&stats.entries_from_mem, &stats.entry_mem_us) (&stats.entries_from_mem, &stats.entry_mem_us)
} else { } else {
@ -109,7 +109,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
let m = Measure::start("entry"); let m = Measure::start("entry");
let mut map = self.map().write().unwrap(); let mut map = self.map().write().unwrap();
let entry = map.entry(*pubkey); let entry = map.entry(*pubkey);
let stats = &self.storage.stats; let stats = &self.stats();
let (count, time) = if matches!(entry, Entry::Occupied(_)) { let (count, time) = if matches!(entry, Entry::Occupied(_)) {
(&stats.entries_from_mem, &stats.entry_mem_us) (&stats.entries_from_mem, &stats.entry_mem_us)
} else { } else {
@ -232,7 +232,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
let m = Measure::start("entry"); let m = Measure::start("entry");
let mut map = self.map().write().unwrap(); let mut map = self.map().write().unwrap();
let entry = map.entry(pubkey); let entry = map.entry(pubkey);
let stats = &self.storage.stats; let stats = &self.stats();
let (count, time) = if matches!(entry, Entry::Occupied(_)) { let (count, time) = if matches!(entry, Entry::Occupied(_)) {
(&stats.entries_from_mem, &stats.entry_mem_us) (&stats.entries_from_mem, &stats.entry_mem_us)
} else { } else {