Skip to content
This repository
Browse code

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

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 6b06c9870aef6c44b99ae07ae8ddcbc4bfb13221 1 parent e7208d3
Tom Lea authored August 14, 2008 jeremy committed November 22, 2008
4  activesupport/lib/active_support/core_ext/string/iterators.rb
@@ -13,7 +13,9 @@ def self.append_features(base)
13 13
         # When $KCODE = 'UTF8', multi-byte characters are yielded appropriately.
14 14
         def each_char
15 15
           scanner, char = StringScanner.new(self), /./mu
16  
-          loop { yield(scanner.scan(char) || break) }
  16
+          while c = scanner.scan(char)
  17
+            yield c
  18
+          end
17 19
         end
18 20
       end
19 21
     end

0 notes on commit 6b06c98

Please sign in to comment.
Something went wrong with that request. Please try again.