Skip to content

Commit f76d712

Browse files
committed
use multi-value case clause instead of fallthrough
Found using https://go-critic.github.io/overview#emptyFallthrough-ref
1 parent 1624edc commit f76d712

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

iter_float.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,7 @@ non_decimal_loop:
145145
}
146146
// too many decimal places
147147
return iter.readFloat32SlowPath()
148-
case invalidCharForNumber:
149-
fallthrough
150-
case dotInNumber:
148+
case invalidCharForNumber, dotInNumber:
151149
return iter.readFloat32SlowPath()
152150
}
153151
decimalPlaces++
@@ -286,9 +284,7 @@ non_decimal_loop:
286284
}
287285
// too many decimal places
288286
return iter.readFloat64SlowPath()
289-
case invalidCharForNumber:
290-
fallthrough
291-
case dotInNumber:
287+
case invalidCharForNumber, dotInNumber:
292288
return iter.readFloat64SlowPath()
293289
}
294290
decimalPlaces++

0 commit comments

Comments
 (0)