Browse Source

much simpler logic without requiring a branch condition

Justin LeFebvre 12 years ago
parent
commit
50c0e52521
1 changed files with 1 additions and 4 deletions
  1. +1
    -4
      semver.go

+ 1
- 4
semver.go View File

@ -360,10 +360,7 @@ func containsOnly(s string, set string) bool {
} }
func hasLeadingZeroes(s string) bool { func hasLeadingZeroes(s string) bool {
if len(s) > 1 {
return strings.HasPrefix(s, "0")
}
return false
return len(s) > 1 && s[0] == '0'
} }
// Creates a new valid build version // Creates a new valid build version


Loading…
Cancel
Save