Skip to content

Commit

Permalink
JSON decoding Ruby 1.9 compat. Mark a section that's unnecessarily slow.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7678 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Sep 29, 2007
1 parent 826f0bd commit 8f68804
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions activesupport/lib/active_support/json/decoding.rb
Expand Up @@ -45,11 +45,12 @@ def convert_json_to_yaml(json) #:nodoc:
if marks.empty? if marks.empty?
json json
else else
ranges = ([0] + marks.map(&:succ)).zip(marks + [json.length]) # FIXME: multiple slow enumerations
output = ranges.collect! { |(left, right)| json[left..right] }.join(" ") output = ([0] + marks.map(&:succ)).
times.each do |pos| zip(marks + [json.length]).
output[pos-1] = ' ' map { |left, right| json[left..right] }.
end join(" ")
times.each { |pos| output[pos-1] = ' ' }
output output
end end
end end
Expand Down

0 comments on commit 8f68804

Please sign in to comment.