Browse files

Changed the fallback String#each_char to use valid 1.9 syntax.

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent ff56137 commit b696f047b5794df207e749269aff5b9536b25de3 @tomlea tomlea committed with jeremy Aug 14, 2008
Showing with 3 additions and 1 deletion.
  1. +3 −1 activesupport/lib/active_support/core_ext/string/iterators.rb
View
4 activesupport/lib/active_support/core_ext/string/iterators.rb
@@ -13,7 +13,9 @@ def self.append_features(base)
# When $KCODE = 'UTF8', multi-byte characters are yielded appropriately.
def each_char
scanner, char = StringScanner.new(self), /./mu
- loop { yield(scanner.scan(char) || break) }
+ while c = scanner.scan(char)
+ yield c
+ end
end
end
end

0 comments on commit b696f04

Please sign in to comment.