diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-11-01 06:13:02 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-11-01 06:13:02 +0900 |
| commit | 57910ca5353e1feba1fb069a876b84a52f33d39f (patch) | |
| tree | d14e7b6aa4f30267b575d59d244e2786fe065da6 /mrblib/string.rb | |
| parent | fe36bdb7f12050254f02a5f2c3a75623dfd289c0 (diff) | |
| download | mruby-57910ca5353e1feba1fb069a876b84a52f33d39f.tar.gz mruby-57910ca5353e1feba1fb069a876b84a52f33d39f.zip | |
String#each_byte to use String#bytes; close #508
Diffstat (limited to 'mrblib/string.rb')
| -rw-r--r-- | mrblib/string.rb | 2 |
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]) |
