From 393e19e508a08ede0f5037bccb984e3eb252d579 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 18 Aug 2014 04:13:18 +0900 Subject: Preload UnicodeDatabase outside the loop This fixes random multibyte_chars_test fail under Ruby 1.9.3. I don't know why the tests fail. And I really don't know why this fixes. Maybe we need some more investigation... --- activesupport/lib/active_support/multibyte/unicode.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/multibyte/unicode.rb b/activesupport/lib/active_support/multibyte/unicode.rb index a4467e0edc..89009d1f55 100644 --- a/activesupport/lib/active_support/multibyte/unicode.rb +++ b/activesupport/lib/active_support/multibyte/unicode.rb @@ -368,6 +368,7 @@ module ActiveSupport private def apply_mapping(string, mapping) #:nodoc: + database.codepoints string.each_codepoint.map do |codepoint| cp = database.codepoints[codepoint] if cp and (ncp = cp.send(mapping)) and ncp > 0 -- cgit v1.2.3