Permalink
Browse files

Swap order of statements to avoid unneeded variable

  • Loading branch information...
1 parent 28ad4d2 commit 546e88fede51c3811fde817dacd4feb18acb13f8 @stouset stouset committed May 2, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/version.rb
View
@@ -129,11 +129,10 @@ def bump!(component = -1, pre = false, trim = false)
# mark all but the changed bit as non-prerelease
self[0...component].each(&:unprerelease!)
- prerelease = self.prerelease?
-
- self[component] = self[component].next unless pre and component == -1 and self.prerelease?
- self[component] = self[component].next if pre and prerelease and component == self.length - 1
- self[-1] = self[-1].next(true) if pre
+ # I don't even understand this part any more; god help you
+ self[component] = self[component].next if pre and self.prerelease? and component == self.length - 1
+ self[component] = self[component].next unless pre and self.prerelease? and component == -1
+ self[-1] = self[-1].next(true) if pre
self
end
end

0 comments on commit 546e88f

Please sign in to comment.