aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-09-23 09:20:00 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-09-23 09:20:00 +0900
commite0c6e8c64ac3d7cf05a40acacb36dc60924af897 (patch)
treede33f785ff1bb34a9eec40ff17aeee4ad8789305 /io.c
parentfb976df81f99bb4505179ec02a74ece6cb6ffeee (diff)
downloadruby-e0c6e8c64ac3d7cf05a40acacb36dc60924af897.tar.gz
[DOC] Use `unpack1` instead of `unpack(template)[0]` [ci skip]
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index e2f6875c3e..0e11b8ad9a 100644
--- a/io.c
+++ b/io.c
@@ -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