list -> slot_list (#23355)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							186bb19965
						
					
				
				
					commit
					30dafc7135
				
			@@ -469,7 +469,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
 | 
			
		||||
    /// or, 'account_info' is appended to the slot list if the slot did not exist previously.
 | 
			
		||||
    /// returns true if caller should addref
 | 
			
		||||
    fn update_slot_list(
 | 
			
		||||
        list: &mut SlotList<T>,
 | 
			
		||||
        slot_list: &mut SlotList<T>,
 | 
			
		||||
        slot: Slot,
 | 
			
		||||
        account_info: T,
 | 
			
		||||
        _other_slot: Option<Slot>,
 | 
			
		||||
@@ -479,20 +479,20 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
 | 
			
		||||
        let mut addref = !account_info.is_cached();
 | 
			
		||||
 | 
			
		||||
        // find other dirty entries from the same slot
 | 
			
		||||
        for list_index in 0..list.len() {
 | 
			
		||||
            let (s, previous_update_value) = &list[list_index];
 | 
			
		||||
        for list_index in 0..slot_list.len() {
 | 
			
		||||
            let (s, previous_update_value) = &slot_list[list_index];
 | 
			
		||||
            if *s == slot {
 | 
			
		||||
                let previous_was_cached = previous_update_value.is_cached();
 | 
			
		||||
                addref = addref && previous_was_cached;
 | 
			
		||||
 | 
			
		||||
                let mut new_item = (slot, account_info);
 | 
			
		||||
                std::mem::swap(&mut new_item, &mut list[list_index]);
 | 
			
		||||
                std::mem::swap(&mut new_item, &mut slot_list[list_index]);
 | 
			
		||||
                if previous_slot_entry_was_cached {
 | 
			
		||||
                    assert!(previous_was_cached);
 | 
			
		||||
                } else {
 | 
			
		||||
                    reclaims.push(new_item);
 | 
			
		||||
                }
 | 
			
		||||
                list[(list_index + 1)..]
 | 
			
		||||
                slot_list[(list_index + 1)..]
 | 
			
		||||
                    .iter()
 | 
			
		||||
                    .for_each(|item| assert!(item.0 != slot));
 | 
			
		||||
                return addref;
 | 
			
		||||
@@ -500,7 +500,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if we make it here, we did not find the slot in the list
 | 
			
		||||
        list.push((slot, account_info));
 | 
			
		||||
        slot_list.push((slot, account_info));
 | 
			
		||||
        addref
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user