add _inclusive (#27302)

This commit is contained in:
Jeff Washington (jwash) 2022-08-22 14:23:58 -05:00 committed by GitHub
parent 97036b1c75
commit 15af69f4c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1286,7 +1286,7 @@ impl<T: IndexValue> AccountsIndex<T> {
&self,
ancestors: Option<&Ancestors>,
slice: SlotSlice<T>,
max_root: Option<Slot>,
max_root_inclusive: Option<Slot>,
) -> Option<usize> {
let mut current_max = 0;
let mut rv = None;
@ -1301,11 +1301,11 @@ impl<T: IndexValue> AccountsIndex<T> {
}
}
let max_root = max_root.unwrap_or(Slot::MAX);
let max_root_inclusive = max_root_inclusive.unwrap_or(Slot::MAX);
let mut tracker = None;
for (i, (slot, _t)) in slice.iter().rev().enumerate() {
if (rv.is_none() || *slot > current_max) && *slot <= max_root {
if (rv.is_none() || *slot > current_max) && *slot <= max_root_inclusive {
let lock = match tracker {
Some(inner) => inner,
None => self.roots_tracker.read().unwrap(),