Return early for the == case in Version#<=>

This commit is contained in:
Jack Nagel 2015-03-17 21:37:03 -04:00
parent 68c7e1e30c
commit 38a8c54898

View File

@ -197,7 +197,7 @@ class Version
def <=>(other)
return unless Version === other
return 0 if head? && other.head?
return 0 if version == other.version
return 1 if head? && !other.head?
return -1 if !head? && other.head?