diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-10-05 11:52:20 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-10-05 11:52:20 -0300 |
commit | abf8de85519141496a6773310964ec03f6106f3f (patch) | |
tree | 5149d0c61125567f0e704d2f520611a1718e168a /activesupport/lib | |
parent | 5c078368c762ec025997af6b2c94632b2f9301d2 (diff) | |
download | rails-abf8de85519141496a6773310964ec03f6106f3f.tar.gz rails-abf8de85519141496a6773310964ec03f6106f3f.tar.bz2 rails-abf8de85519141496a6773310964ec03f6106f3f.zip |
Use flat_map { } instead of map {}.flatten
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/multibyte/unicode.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/multibyte/unicode.rb b/activesupport/lib/active_support/multibyte/unicode.rb index f49ca47f14..d7a403c45b 100644 --- a/activesupport/lib/active_support/multibyte/unicode.rb +++ b/activesupport/lib/active_support/multibyte/unicode.rb @@ -219,9 +219,9 @@ module ActiveSupport # encoding is entirely CP1252 or ISO-8859-1. def tidy_bytes(string, force = false) if force - return string.unpack("C*").map do |b| + return string.unpack("C*").flat_map do |b| tidy_byte(b) - end.flatten.compact.pack("C*").unpack("U*").pack("U*") + end.compact.pack("C*").unpack("U*").pack("U*") end bytes = string.unpack("C*") |