mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* enum.c (inject_i): use rb_yield_values.
* enum.c (each_with_index_i): ditto. * eval.c (rb_yield_splat): new function to call "yield *values". * string.c (rb_str_scan): use rb_yield_splat(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7cca6c25f0
commit
7ff7bcbf9d
8 changed files with 41 additions and 14 deletions
|
@ -95,7 +95,10 @@ class << Singleton
|
|||
@__instance__ = new
|
||||
ensure
|
||||
if @__instance__
|
||||
def self.instance; @__instance__ end
|
||||
class <<self
|
||||
remove_method :instance
|
||||
def instance; @__instance__ end
|
||||
end
|
||||
else
|
||||
@__instance__ = nil # failed instance creation
|
||||
end
|
||||
|
@ -109,7 +112,10 @@ class << Singleton
|
|||
@__instance__ = new
|
||||
ensure
|
||||
if @__instance__
|
||||
def self.instance; @__instance__ end
|
||||
class <<self
|
||||
remove_method :instance
|
||||
def instance; @__instance__ end
|
||||
end
|
||||
else
|
||||
@__instance__ = nil
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue