aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/json/decoding.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb
index b6370ddb0e..cb5f2a222a 100644
--- a/activesupport/lib/active_support/json/decoding.rb
+++ b/activesupport/lib/active_support/json/decoding.rb
@@ -45,11 +45,12 @@ module ActiveSupport
if marks.empty?
json
else
- ranges = ([0] + marks.map(&:succ)).zip(marks + [json.length])
- output = ranges.collect! { |(left, right)| json[left..right] }.join(" ")
- times.each do |pos|
- output[pos-1] = ' '
- end
+ # FIXME: multiple slow enumerations
+ output = ([0] + marks.map(&:succ)).
+ zip(marks + [json.length]).
+ map { |left, right| json[left..right] }.
+ join(" ")
+ times.each { |pos| output[pos-1] = ' ' }
output
end
end