Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Using times instead of each when implementing Fibonnaci #20

Merged
merged 1 commit into from

3 participants

@kjbekkelund

As the variable in each is never used, using times seems better.

@oc

+1 much nicer! :)

@rchatley rchatley merged commit de51946 into rchatley:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/extreme_startup/question_factory.rb
View
2  lib/extreme_startup/question_factory.rb
@@ -277,7 +277,7 @@ def points
def correct_answer
n = @n1 + 4
a, b = 0, 1
- (0...n).each { |_| a, b = b, a + b }
+ n.times { a, b = b, a + b }
a
end
end
Something went wrong with that request. Please try again.