mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
String#each_byte to use String#bytes; close #508
This commit is contained in:
+1
-1
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user