mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Refactoring Array#__svalue
This commit is contained in:
+2
-5
@@ -187,11 +187,8 @@ class Array
|
||||
|
||||
# internal method to convert multi-value to single value
|
||||
def __svalue
|
||||
case self.size
|
||||
when 0
|
||||
return nil
|
||||
when 1
|
||||
self[0]
|
||||
if self.size < 2
|
||||
self.first
|
||||
else
|
||||
self
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user