@@ -368,8 +368,8 @@ + (NSString *)parseDiffChunk:(NSString *)txt
368
368
NSMutableString *res=[NSMutableString string ];
369
369
370
370
NSString *line;
371
- int l_line,l_end ;
372
- int r_line,r_end ;
371
+ int l_line;
372
+ int r_line;
373
373
374
374
line=[lines nextObject ];
375
375
DLog (@" -=%@ =-" ,line);
@@ -381,19 +381,11 @@ + (NSString *)parseDiffChunk:(NSString *)txt
381
381
NSArray *pos_l=[[pos objectAtIndex: 0 ] componentsSeparatedByString: @" ," ];
382
382
NSArray *pos_r=[[pos objectAtIndex: 1 ] componentsSeparatedByString: @" ," ];
383
383
384
- l_end=l_line=abs ([[pos_l objectAtIndex: 0 ]integerValue]);
385
- if ([pos_l count ]>1 ) {
386
- l_end=l_line+[[pos_l objectAtIndex: 1 ]integerValue];
387
- }
388
-
389
- r_end=r_line=[[pos_r objectAtIndex: 0 ]integerValue];
390
- if ([pos_r count ]>1 ) {
391
- r_end=r_line+[[pos_r objectAtIndex: 1 ]integerValue];
392
- }
393
-
384
+ l_line=abs ([[pos_l objectAtIndex: 0 ]integerValue]);
385
+ r_line=[[pos_r objectAtIndex: 0 ]integerValue];
386
+
394
387
[res appendString: [NSString stringWithFormat: @" <tr class='header'><td colspan='3'>%@ </td></tr>" ,line]];
395
- do {
396
- line=[lines nextObject ];
388
+ while ((line=[lines nextObject ])){
397
389
NSString *s=[line substringToIndex: 1 ];
398
390
if ([s isEqualToString: @" " ]){
399
391
[res appendString: [NSString stringWithFormat: @" <tr><td class='l'>%d </td><td class='r'>%d </td>" ,l_line++,r_line++]];
@@ -405,7 +397,7 @@ + (NSString *)parseDiffChunk:(NSString *)txt
405
397
if (![s isEqualToString: @" \\ " ]){
406
398
[res appendString: [NSString stringWithFormat: @" <td class='code'>%@ </td></tr>" ,[line substringFromIndex: 1 ]]];
407
399
}
408
- }while ((l_line<l_end) || (r_line<r_end));
400
+ }
409
401
return res;
410
402
}
411
403
0 commit comments