* lib/prime.rb: Simplify and optimize EratosthenesSieve
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d3c64a40a
commit
7ea2bb3235
@ -1,6 +1,10 @@
|
|||||||
|
Tue Jun 9 12:31:25 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
|
* lib/prime.rb: Simplify and optimize EratosthenesSieve
|
||||||
|
|
||||||
Tue Jun 9 11:45:00 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
Tue Jun 9 11:45:00 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
* lib/matrix.rb: Simplify and optimize EratosthenesSieve
|
* lib/prime.rb: Simplify and optimize EratosthenesSieve
|
||||||
based on patch by Ajay Kumar. [Fixes GH-921]
|
based on patch by Ajay Kumar. [Fixes GH-921]
|
||||||
|
|
||||||
Mon Jun 8 05:09:58 2015 Koichi Sasada <ko1@atdot.net>
|
Mon Jun 8 05:09:58 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
@ -436,9 +436,8 @@ class Prime
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
segment.each do |prime|
|
@primes.concat(segment.compact!)
|
||||||
@primes.push prime unless prime.nil?
|
|
||||||
end
|
|
||||||
@max_checked = segment_max
|
@max_checked = segment_max
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user