mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
JSON decoding Ruby 1.9 compat. Mark a section that's unnecessarily slow.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7678 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user