File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -83,24 +83,20 @@ mod impls {
8383 & self , key : StorageKeyWithSpace ,
8484 ) -> Result < Option < Arc < [ u8 ] > > > {
8585 let key_bytes = key. to_key_bytes ( ) ;
86- let mut r;
86+ let r;
8787 let accessed_entries_read_guard = self . accessed_entries . read ( ) ;
8888 if let Some ( v) = accessed_entries_read_guard. get ( & key_bytes) {
8989 r = v. current_value . clone ( ) ;
9090 } else {
9191 drop ( accessed_entries_read_guard) ;
92- r = self . storage . get ( key) ?. map ( Into :: into) ;
9392 let mut accessed_entries = self . accessed_entries . write ( ) ;
9493 let entry = accessed_entries. entry ( key_bytes) ;
95- let was_vacant = if let Occupied ( o) = & entry {
94+ if let Occupied ( o) = & entry {
9695 r = o. get ( ) . current_value . clone ( ) ;
97- false
9896 } else {
99- true
100- } ;
101- if was_vacant {
97+ r = self . storage . get ( key) ?. map ( Into :: into) ;
10298 entry. or_insert ( EntryValue :: new ( r. clone ( ) ) ) ;
103- }
99+ } ;
104100 } ;
105101 trace ! ( "get_raw key={:?}, value={:?}" , key, r) ;
106102 Ok ( r)
You can’t perform that action at this time.
0 commit comments