@@ -416,9 +416,7 @@ public static decimal ParseDecimal(this StringSegment value, bool allowThousands
416
416
state = ParseState . FractionNumber ;
417
417
418
418
if ( i == end )
419
- {
420
419
throw new FormatException ( BadFormat ) ;
421
- }
422
420
}
423
421
else if ( c == '0' )
424
422
{
@@ -429,10 +427,7 @@ public static decimal ParseDecimal(this StringSegment value, bool allowThousands
429
427
preResult = ( ulong ) ( c - '0' ) ;
430
428
state = ParseState . Number ;
431
429
}
432
- else
433
- {
434
- throw new FormatException ( BadFormat ) ;
435
- }
430
+ else throw new FormatException ( BadFormat ) ;
436
431
break ;
437
432
case ParseState . Sign :
438
433
if ( c == '.' )
@@ -441,9 +436,7 @@ public static decimal ParseDecimal(this StringSegment value, bool allowThousands
441
436
state = ParseState . FractionNumber ;
442
437
443
438
if ( i == end )
444
- {
445
439
throw new FormatException ( BadFormat ) ;
446
- }
447
440
}
448
441
else if ( c == '0' )
449
442
{
@@ -454,10 +447,7 @@ public static decimal ParseDecimal(this StringSegment value, bool allowThousands
454
447
preResult = ( ulong ) ( c - '0' ) ;
455
448
state = ParseState . Number ;
456
449
}
457
- else
458
- {
459
- throw new FormatException ( BadFormat ) ;
460
- }
450
+ else throw new FormatException ( BadFormat ) ;
461
451
break ;
462
452
case ParseState . Number :
463
453
if ( c == '.' )
@@ -490,20 +480,14 @@ public static decimal ParseDecimal(this StringSegment value, bool allowThousands
490
480
else if ( allowThousands && c == ',' )
491
481
{
492
482
}
493
- else
494
- {
495
- throw new FormatException ( BadFormat ) ;
496
- }
483
+ else throw new FormatException ( BadFormat ) ;
497
484
break ;
498
485
case ParseState . DecimalPoint :
499
486
if ( c == '.' )
500
487
{
501
488
state = ParseState . FractionNumber ;
502
489
}
503
- else
504
- {
505
- throw new FormatException ( BadFormat ) ;
506
- }
490
+ else throw new FormatException ( BadFormat ) ;
507
491
break ;
508
492
case ParseState . FractionNumber :
509
493
if ( JsonUtils . IsWhiteSpace ( c ) )
@@ -538,10 +522,7 @@ public static decimal ParseDecimal(this StringSegment value, bool allowThousands
538
522
}
539
523
scale ++ ;
540
524
}
541
- else
542
- {
543
- throw new FormatException ( BadFormat ) ;
544
- }
525
+ else throw new FormatException ( BadFormat ) ;
545
526
break ;
546
527
case ParseState . Exponent :
547
528
bool expNegative = false ;
@@ -602,10 +583,7 @@ public static decimal ParseDecimal(this StringSegment value, bool allowThousands
602
583
//set i to end of string, because ParseInt16 eats number and all trailing whites
603
584
i = end ;
604
585
}
605
- else
606
- {
607
- throw new FormatException ( BadFormat ) ;
608
- }
586
+ else throw new FormatException ( BadFormat ) ;
609
587
break ;
610
588
case ParseState . TrailingWhite :
611
589
if ( ! JsonUtils . IsWhiteSpace ( c ) )
0 commit comments