summaryrefslogtreecommitdiffhomepage
path: root/mrblib/array.rb
diff options
context:
space:
mode:
authorYukihiro Matz Matsumoto <[email protected]>2013-01-16 18:35:25 +0900
committerYukihiro Matz Matsumoto <[email protected]>2013-01-16 18:35:25 +0900
commit5166aa726df2281539183094b160806f008d352b (patch)
tree99349a1bad98733402f6744db9479bacdf867813 /mrblib/array.rb
parent79d38c496266faccc9823b396a103c892ee11259 (diff)
downloadmruby-5166aa726df2281539183094b160806f008d352b.tar.gz
mruby-5166aa726df2281539183094b160806f008d352b.zip
check if array expands in each block
Diffstat (limited to 'mrblib/array.rb')
-rw-r--r--mrblib/array.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrblib/array.rb b/mrblib/array.rb
index dba32c398..56bf5ceb2 100644
--- a/mrblib/array.rb
+++ b/mrblib/array.rb
@@ -11,7 +11,7 @@ class Array
# ISO 15.2.12.5.10
def each(&block)
idx, length = -1, self.length-1
- while(idx < length)
+ while idx < length and length < self.length and length = self.length-1
elm = self[idx += 1]
unless elm
if elm == nil and length >= self.length