File tree Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -1319,24 +1319,18 @@ impl<D: Decoder> Decodable<D> for SourceFile {
13191319 lines. push ( line_start) ;
13201320
13211321 match bytes_per_diff {
1322- 1 => {
1323- for _ in 1 ..num_lines {
1324- line_start = line_start + BytePos ( d. read_u8 ( ) as u32 ) ;
1325- lines. push ( line_start) ;
1326- }
1327- }
1328- 2 => {
1329- for _ in 1 ..num_lines {
1330- line_start = line_start + BytePos ( d. read_u16 ( ) as u32 ) ;
1331- lines. push ( line_start) ;
1332- }
1333- }
1334- 4 => {
1335- for _ in 1 ..num_lines {
1336- line_start = line_start + BytePos ( d. read_u32 ( ) ) ;
1337- lines. push ( line_start) ;
1338- }
1339- }
1322+ 1 => lines. extend ( ( 1 ..num_lines) . map ( |_| {
1323+ line_start = line_start + BytePos ( d. read_u8 ( ) as u32 ) ;
1324+ line_start
1325+ } ) ) ,
1326+ 2 => lines. extend ( ( 1 ..num_lines) . map ( |_| {
1327+ line_start = line_start + BytePos ( d. read_u16 ( ) as u32 ) ;
1328+ line_start
1329+ } ) ) ,
1330+ 4 => lines. extend ( ( 1 ..num_lines) . map ( |_| {
1331+ line_start = line_start + BytePos ( d. read_u32 ( ) ) ;
1332+ line_start
1333+ } ) ) ,
13401334 _ => unreachable ! ( ) ,
13411335 }
13421336 }
You can’t perform that action at this time.
0 commit comments