1
0
mirror of https://github.com/json-iterator/go.git synced 2024-11-24 08:22:14 +02:00

Merge pull request #304 from Quasilyte/quasilyte/emptyFallthrough

use multi-value case clause instead of fallthrough
This commit is contained in:
Tao Wen 2018-09-14 09:48:43 +08:00 committed by GitHub
commit 2433035e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,9 +145,7 @@ non_decimal_loop:
}
// too many decimal places
return iter.readFloat32SlowPath()
case invalidCharForNumber:
fallthrough
case dotInNumber:
case invalidCharForNumber, dotInNumber:
return iter.readFloat32SlowPath()
}
decimalPlaces++
@ -286,9 +284,7 @@ non_decimal_loop:
}
// too many decimal places
return iter.readFloat64SlowPath()
case invalidCharForNumber:
fallthrough
case dotInNumber:
case invalidCharForNumber, dotInNumber:
return iter.readFloat64SlowPath()
}
decimalPlaces++