Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ The following bundled gems are updated.

## Compatibility issues

* The following methods were removed from Ractor due because of `Ractor::Port`:
* The following methods were removed from Ractor due to the addition of `Ractor::Port`:

* `Ractor.yield`
* `Ractor#take`
Expand Down
1 change: 1 addition & 0 deletions ext/.document
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ readline/readline.c
ripper/lib
socket
stringio/stringio.c
strscan/lib
strscan/strscan.c
syslog/syslog.c
syslog/lib
Expand Down
4 changes: 2 additions & 2 deletions io_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2231,7 +2231,7 @@ io_buffer_values(int argc, VALUE *argv, VALUE self)

/*
* call-seq:
* each_byte([offset, [count]]) {|offset, byte| ...} -> self
* each_byte([offset, [count]]) {|byte| ...} -> self
* each_byte([offset, [count]]) -> enumerator
*
* Iterates over the buffer, yielding each byte starting from +offset+.
Expand All @@ -2255,7 +2255,7 @@ io_buffer_each_byte(int argc, VALUE *argv, VALUE self)
rb_io_buffer_get_bytes_for_reading(self, &base, &size);

size_t offset, count;
io_buffer_extract_offset_count(RB_IO_BUFFER_DATA_TYPE_U8, size, argc-1, argv+1, &offset, &count);
io_buffer_extract_offset_count(RB_IO_BUFFER_DATA_TYPE_U8, size, argc, argv, &offset, &count);

for (size_t i = 0; i < count; i++) {
unsigned char *value = (unsigned char *)base + i + offset;
Expand Down
1 change: 1 addition & 0 deletions test/ruby/test_io_buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ def test_each_byte
buffer = IO::Buffer.for(string)

assert_equal string.bytes, buffer.each_byte.to_a
assert_equal string.bytes[3, 5], buffer.each_byte(3, 5).to_a
end

def test_zero_length_each_byte
Expand Down