Skip to content

Commit

Permalink
Swap order of statements to avoid unneeded variable
Browse files Browse the repository at this point in the history
  • Loading branch information
stouset committed May 2, 2011
1 parent 28ad4d2 commit 546e88f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/version.rb
Expand Up @@ -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
Expand Down

0 comments on commit 546e88f

Please sign in to comment.