AcctIdx: held ranges search in lifo order (#21964)
This commit is contained in:
parent
5d40da5688
commit
c4389a6675
|
@ -654,7 +654,8 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
|
||||||
ranges.push(inclusive_range);
|
ranges.push(inclusive_range);
|
||||||
} else {
|
} else {
|
||||||
// find the matching range and delete it since we don't want to hold it anymore
|
// find the matching range and delete it since we don't want to hold it anymore
|
||||||
for (i, r) in ranges.iter().enumerate() {
|
// search backwards, assuming LIFO ordering
|
||||||
|
for (i, r) in ranges.iter().enumerate().rev() {
|
||||||
if let (Bound::Included(start_found), Bound::Included(end_found)) =
|
if let (Bound::Included(start_found), Bound::Included(end_found)) =
|
||||||
(r.start_bound(), r.end_bound())
|
(r.start_bound(), r.end_bound())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue