diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-09-23 09:20:00 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-09-23 09:20:00 +0900 |
commit | e0c6e8c64ac3d7cf05a40acacb36dc60924af897 (patch) | |
tree | de33f785ff1bb34a9eec40ff17aeee4ad8789305 /io.c | |
parent | fb976df81f99bb4505179ec02a74ece6cb6ffeee (diff) | |
download | ruby-e0c6e8c64ac3d7cf05a40acacb36dc60924af897.tar.gz |
[DOC] Use `unpack1` instead of `unpack(template)[0]` [ci skip]
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3324,7 +3324,7 @@ io_write_nonblock(rb_execution_context_t *ec, VALUE io, VALUE str, VALUE ex) * # each record is prefixed by its 32-bit length * open("variable-record-file") do |f| * while len = f.read(4) - * len = len.unpack("N")[0] # 32-bit length + * len = len.unpack1("N") # 32-bit length * record = f.read(len) # This returns a string even if len is 0. * end * end |