mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
use __svalue instead of ary2sv
This commit is contained in:
@@ -297,7 +297,7 @@ class Enumerator
|
||||
# side-effect
|
||||
#
|
||||
def next
|
||||
ary2sv next_values, false
|
||||
next_values.__svalue
|
||||
end
|
||||
|
||||
##
|
||||
@@ -405,7 +405,7 @@ class Enumerator
|
||||
# p e.next #raises StopIteration
|
||||
#
|
||||
def peek
|
||||
ary2sv peek_values, true
|
||||
peek_values.__svalue
|
||||
end
|
||||
|
||||
##
|
||||
@@ -510,22 +510,6 @@ class Enumerator
|
||||
nil
|
||||
end
|
||||
|
||||
# just for internal
|
||||
def ary2sv args, dup
|
||||
return args unless args.kind_of? Array
|
||||
|
||||
case args.length
|
||||
when 0
|
||||
nil
|
||||
when 1
|
||||
args[0]
|
||||
else
|
||||
return args.dup if dup
|
||||
args
|
||||
end
|
||||
end
|
||||
private :ary2sv
|
||||
|
||||
# just for internal
|
||||
class Generator
|
||||
def initialize &block
|
||||
|
||||
Reference in New Issue
Block a user