From: Gabriel Aszalos Date: Tue, 17 Oct 2017 17:57:01 +0000 (+0200) Subject: flag: simplify switch-case in isZeroValue X-Git-Tag: go1.10beta1~680 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5f740d6875ab6961381f2f4614b21ff6ddf448a4;p=gostls13.git flag: simplify switch-case in isZeroValue Simplifies the switch statement in the isZeroValue function by merging the case branches. Change-Id: I5b27939b62808dadac0cef632567b17e0e2b9a1d Reviewed-on: https://go-review.googlesource.com/71390 Run-TryBot: Gabriel Aszalos TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/flag/flag.go b/src/flag/flag.go index 5544a25282..fde7411f82 100644 --- a/src/flag/flag.go +++ b/src/flag/flag.go @@ -400,11 +400,7 @@ func isZeroValue(flag *Flag, value string) bool { } switch value { - case "false": - return true - case "": - return true - case "0": + case "false", "", "0": return true } return false