Skip to content

Commit

Permalink
String manipulation is not the fastpath
Browse files Browse the repository at this point in the history
  • Loading branch information
sdboyer committed Mar 29, 2016
1 parent 2ea07dc commit 26510d1
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ func (v *Version) Equal(o *Version) bool {
// Versions are compared by X.Y.Z. Build metadata is ignored. Prerelease is
// lower than the version without a prerelease.
func (v *Version) Compare(o *Version) int {

// Fastpath if both versions are the same.
if v.String() == o.String() {
return 0
}

// Compare the major, minor, and patch version for differences. If a
// difference is found return the comparison.
if d := compareSegment(v.Major(), o.Major()); d != 0 {
Expand Down

0 comments on commit 26510d1

Please sign in to comment.