diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-13 00:38:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-13 00:38:07 +0000 |
commit | a8998030fbabc0f604f82350a0767002a86f6068 (patch) | |
tree | f7bad21db5558977f5dcbc7604ece5024c182c70 | |
parent | 63b231cea0389dd9c8b9ae471b89ab0c1395d4d4 (diff) | |
download | ruby-a8998030fbabc0f604f82350a0767002a86f6068.tar.gz |
* lib/prime.rb (EratosthenesGenerator#initialize): call super.
(TrialDivisionGenerator, Generator23): ditto. [ruby-core:25539]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/prime.rb | 7 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Sun Sep 13 09:38:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/prime.rb (EratosthenesGenerator#initialize): call super. + (TrialDivisionGenerator, Generator23): ditto. [ruby-core:25539] + Sun Sep 13 09:34:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * vm_method.c (rb_add_method_def): no warning for inherited diff --git a/lib/prime.rb b/lib/prime.rb index 68253897ca..a7005f8962 100644 --- a/lib/prime.rb +++ b/lib/prime.rb @@ -91,14 +91,14 @@ class Prime warn "Prime::new is obsolete. use Prime::instance or class methods of Prime." end - class<<self + class << self extend Forwardable include Enumerable # Returns the default instance of Prime. def instance; @the_instance end def method_added(method) # :nodoc: - (class<<self;self;end).def_delegator :instance, method + (class<< self;self;end).def_delegator :instance, method end end @@ -290,6 +290,7 @@ class Prime class EratosthenesGenerator < PseudoPrimeGenerator def initialize @last_prime = nil + super end def succ @@ -306,6 +307,7 @@ class Prime class TrialDivisionGenerator<PseudoPrimeGenerator def initialize @index = -1 + super end def succ @@ -327,6 +329,7 @@ class Prime def initialize @prime = 1 @step = nil + super end def succ |