aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorPablo Herrero <pablodherrero@gmail.com>2014-11-01 20:16:03 -0300
committerPablo Herrero <pablodherrero@gmail.com>2014-11-01 20:23:29 -0300
commit861b70e92f4a1fc0e465ffcf2ee62680519c8f6f (patch)
treecc5ce3c824b091cc88fb2c9c1f8557905108f265 /actionpack
parentdaab7e59a6196fa2bbab17dc4a88b095a211fc96 (diff)
downloadrails-861b70e92f4a1fc0e465ffcf2ee62680519c8f6f.tar.gz
rails-861b70e92f4a1fc0e465ffcf2ee62680519c8f6f.tar.bz2
rails-861b70e92f4a1fc0e465ffcf2ee62680519c8f6f.zip
Call gsub with a Regexp instead of a String for better performance
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/live.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/live.rb b/actionpack/lib/action_controller/metal/live.rb
index c9ef3a3dad..1e13b3761f 100644
--- a/actionpack/lib/action_controller/metal/live.rb
+++ b/actionpack/lib/action_controller/metal/live.rb
@@ -102,7 +102,7 @@ module ActionController
end
end
- message = json.gsub("\n", "\ndata: ")
+ message = json.gsub(/\n/, "\ndata: ")
@stream.write "data: #{message}\n\n"
end
end