Commit 57910ca5 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

String#each_byte to use String#bytes; close #508

parent fe36bdb7
......@@ -118,7 +118,7 @@ class String
##
# Call the given block for each byte of +self+.
def each_byte(&block)
bytes = self.unpack("C*")
bytes = self.bytes
pos = 0
while(pos < bytes.size)
block.call(bytes[pos])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment