File tree Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -123,27 +123,25 @@ impl<'sm> CachingSourceMapView<'sm> {
123123
124124 if lo_cache_idx != -1 && hi_cache_idx != -1 {
125125 // Cache hit for span lo and hi. Check if they belong to the same file.
126- let result = {
127- let lo = & self . line_cache [ lo_cache_idx as usize ] ;
128- let hi = & self . line_cache [ hi_cache_idx as usize ] ;
126+ let lo_file_index = self . line_cache [ lo_cache_idx as usize ] . file_index ;
127+ let hi_file_index = self . line_cache [ hi_cache_idx as usize ] . file_index ;
129128
130- if lo. file_index != hi. file_index {
131- return None ;
132- }
133-
134- (
135- lo. file . stable_id ,
136- lo. line_number ,
137- span_data. lo - lo. line . start ,
138- hi. line_number ,
139- span_data. hi - hi. line . start ,
140- )
141- } ;
129+ if lo_file_index != hi_file_index {
130+ return None ;
131+ }
142132
143133 self . line_cache [ lo_cache_idx as usize ] . touch ( self . time_stamp ) ;
144134 self . line_cache [ hi_cache_idx as usize ] . touch ( self . time_stamp ) ;
145135
146- return Some ( result) ;
136+ let lo = & self . line_cache [ lo_cache_idx as usize ] ;
137+ let hi = & self . line_cache [ hi_cache_idx as usize ] ;
138+ return Some ( (
139+ lo. file . stable_id ,
140+ lo. line_number ,
141+ span_data. lo - lo. line . start ,
142+ hi. line_number ,
143+ span_data. hi - hi. line . start ,
144+ ) ) ;
147145 }
148146
149147 // No cache hit or cache hit for only one of span lo and hi.
You can’t perform that action at this time.
0 commit comments