Skip to content

Commit a14915c

Browse files
committed
Do not have Enumeratory::Lazy#zip mark result as packed
Fixes [Bug #19569]
1 parent c94b5f1 commit a14915c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

enumerator.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,6 @@ lazy_zip_arrays_func(VALUE proc_entry, struct MEMO *result, VALUE memos, long me
23692369
rb_ary_push(ary, rb_ary_entry(RARRAY_AREF(arrays, i), count));
23702370
}
23712371
LAZY_MEMO_SET_VALUE(result, ary);
2372-
LAZY_MEMO_SET_PACKED(result);
23732372
rb_ary_store(memos, memo_index, LONG2NUM(++count));
23742373
return result;
23752374
}

test/ruby/test_lazy_enumerator.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ def test_zip_with_block
282282
assert_equal(3, a.current)
283283
end
284284

285+
def test_zip_map_lambda_bug_19569
286+
ary = [1, 2, 3].to_enum.lazy.zip([:a, :b, :c]).map(&:last).to_a
287+
assert_equal([:a, :b, :c], ary)
288+
end
289+
285290
def test_take
286291
a = Step.new(1..10)
287292
assert_equal(1, a.take(5).first)

0 commit comments

Comments
 (0)