summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-11-01 06:13:02 +0900
committerYukihiro Matsumoto <[email protected]>2012-11-01 06:13:02 +0900
commit57910ca5353e1feba1fb069a876b84a52f33d39f (patch)
treed14e7b6aa4f30267b575d59d244e2786fe065da6
parentfe36bdb7f12050254f02a5f2c3a75623dfd289c0 (diff)
downloadmruby-57910ca5353e1feba1fb069a876b84a52f33d39f.tar.gz
mruby-57910ca5353e1feba1fb069a876b84a52f33d39f.zip
String#each_byte to use String#bytes; close #508
-rw-r--r--mrblib/string.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrblib/string.rb b/mrblib/string.rb
index d09b787da..0b995f9ca 100644
--- a/mrblib/string.rb
+++ b/mrblib/string.rb
@@ -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])