File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -135,15 +135,15 @@ impl<F: MetadataFetch> ReadaheadMetadataCache<F> {
135135impl < F : MetadataFetch + Send + Sync > MetadataFetch for ReadaheadMetadataCache < F > {
136136 fn fetch ( & self , range : Range < u64 > ) -> BoxFuture < ' _ , AsyncTiffResult < Bytes > > {
137137 Box :: pin ( async move {
138- let mut g = self . cache . lock ( ) . await ;
138+ let mut cache = self . cache . lock ( ) . await ;
139139
140140 // First check if we already have the range cached
141- if g . contains ( range. start ..range. end ) {
142- return Ok ( g . slice ( range) ) ;
141+ if cache . contains ( range. start ..range. end ) {
142+ return Ok ( cache . slice ( range) ) ;
143143 }
144144
145145 // Compute the correct fetch range
146- let start_len = g . len ;
146+ let start_len = cache . len ;
147147 let needed = range. end . saturating_sub ( start_len) ;
148148 let fetch_size = self . next_fetch_size ( start_len) . max ( needed) ;
149149 let fetch_range = start_len..start_len + fetch_size;
@@ -153,9 +153,9 @@ impl<F: MetadataFetch + Send + Sync> MetadataFetch for ReadaheadMetadataCache<F>
153153 let bytes = self . inner . fetch ( fetch_range) . await ?;
154154
155155 // Now append safely
156- g . append_buffer ( bytes) ;
156+ cache . append_buffer ( bytes) ;
157157
158- Ok ( g . slice ( range) )
158+ Ok ( cache . slice ( range) )
159159 } )
160160 }
161161}
You can’t perform that action at this time.
0 commit comments