This repository was archived by the owner on Aug 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -1368,13 +1368,7 @@ - (int)diff_digit16:(unichar)c
1368
1368
1369
1369
- (NSString *)diff_decodeURIWithText : (NSString *)percentEncoded
1370
1370
{
1371
- NSInteger inputLength = [percentEncoded length ];
1372
-
1373
- if (0 == inputLength) {
1374
- return @" " ;
1375
- }
1376
-
1377
- unichar decoded[inputLength];
1371
+ unichar decoded[[percentEncoded length ]];
1378
1372
NSInteger input = 0 ;
1379
1373
NSInteger output = 0 ;
1380
1374
@@ -1388,10 +1382,6 @@ - (NSString *)diff_decodeURIWithText:(NSString *)percentEncoded
1388
1382
continue ;
1389
1383
}
1390
1384
1391
- if (inputLength < input + 3 ) {
1392
- return nil ;
1393
- }
1394
-
1395
1385
int byte1 = ([self diff_digit16: [percentEncoded characterAtIndex: (input+1 )]] << 4 ) +
1396
1386
[self diff_digit16: [percentEncoded characterAtIndex: (input+2 )]];
1397
1387
@@ -1401,7 +1391,7 @@ - (NSString *)diff_decodeURIWithText:(NSString *)percentEncoded
1401
1391
continue ;
1402
1392
}
1403
1393
1404
- if (inputLength < input + 6 || ' %' != [percentEncoded characterAtIndex: (input + 3 )]) {
1394
+ if (' %' != [percentEncoded characterAtIndex: (input + 3 )]) {
1405
1395
return nil ;
1406
1396
}
1407
1397
@@ -1420,7 +1410,7 @@ - (NSString *)diff_decodeURIWithText:(NSString *)percentEncoded
1420
1410
continue ;
1421
1411
}
1422
1412
1423
- if (inputLength < input + 9 || ' %' != [percentEncoded characterAtIndex: (input + 6 )]) {
1413
+ if (' %' != [percentEncoded characterAtIndex: (input + 6 )]) {
1424
1414
return nil ;
1425
1415
}
1426
1416
@@ -1439,7 +1429,7 @@ - (NSString *)diff_decodeURIWithText:(NSString *)percentEncoded
1439
1429
continue ;
1440
1430
}
1441
1431
1442
- if (inputLength < input + 12 || ' %' != [percentEncoded characterAtIndex: (input + 9 )]) {
1432
+ if (' %' != [percentEncoded characterAtIndex: (input + 9 )]) {
1443
1433
return nil ;
1444
1434
}
1445
1435
You can’t perform that action at this time.
0 commit comments