1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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:
marcandre 2015-06-09 03:32:45 +00:00
parent 9d3c64a40a
commit 7ea2bb3235
2 changed files with 7 additions and 4 deletions

View file

@ -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>
* lib/matrix.rb: Simplify and optimize EratosthenesSieve
* lib/prime.rb: Simplify and optimize EratosthenesSieve
based on patch by Ajay Kumar. [Fixes GH-921]
Mon Jun 8 05:09:58 2015 Koichi Sasada <ko1@atdot.net>

View file

@ -436,9 +436,8 @@ class Prime
end
end
segment.each do |prime|
@primes.push prime unless prime.nil?
end
@primes.concat(segment.compact!)
@max_checked = segment_max
end
end