File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -1838,13 +1838,16 @@ impl GlobalScope {
18381838 } ;
18391839 match parent {
18401840 Some ( ( parent_id, rel_pos) ) => {
1841- let parent_file_id = {
1842- let parent_info = blobs_map
1843- . get_mut ( & parent_id)
1844- . expect ( "Parent of blob whose url is requested is unknown." ) ;
1845- self . promote ( parent_info, /* set_valid is */ false )
1841+ let parent_info = blobs_map
1842+ . get_mut ( & parent_id)
1843+ . expect ( "Parent of blob whose url is requested is unknown." ) ;
1844+ let parent_file_id = self . promote ( parent_info, /* set_valid is */ false ) ;
1845+ let parent_size = match parent_info. blob_impl . blob_data ( ) {
1846+ BlobData :: File ( ref f) => f. get_size ( ) ,
1847+ BlobData :: Memory ( ref v) => v. len ( ) as u64 ,
1848+ BlobData :: Sliced ( _, _) => panic ! ( "Blob ancestry should be only one level." ) ,
18461849 } ;
1847- let parent_size = self . get_blob_size ( & parent_id ) ;
1850+ let parent_size = rel_pos . to_abs_range ( parent_size as usize ) . len ( ) as u64 ;
18481851 let blob_info = blobs_map
18491852 . get_mut ( blob_id)
18501853 . expect ( "Blob whose url is requested is unknown." ) ;
You can’t perform that action at this time.
0 commit comments