Grab read-lock instead of write-lock in From<PreAllocatedAccountMapEntry<T>> for (Slot, T) (#25770)
This commit is contained in:
parent
0da0e0da63
commit
edebd7e495
|
@ -369,7 +369,7 @@ impl<T: IndexValue> ZeroLamport for PreAllocatedAccountMapEntry<T> {
|
|||
impl<T: IndexValue> From<PreAllocatedAccountMapEntry<T>> for (Slot, T) {
|
||||
fn from(source: PreAllocatedAccountMapEntry<T>) -> (Slot, T) {
|
||||
match source {
|
||||
PreAllocatedAccountMapEntry::Entry(entry) => entry.slot_list.write().unwrap().remove(0),
|
||||
PreAllocatedAccountMapEntry::Entry(entry) => entry.slot_list.read().unwrap()[0],
|
||||
PreAllocatedAccountMapEntry::Raw(raw) => raw,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue