1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/lib/action_view/helpers
yuuji.yaginuma 1b86d90136 Enable Performance/UnfreezeString cop
In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`.

```ruby
# frozen_string_literal: true

require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"

  gem "benchmark-ips"
end

Benchmark.ips do |x|
  x.report('+@') { +"" }
  x.report('dup') { "".dup }
  x.compare!
end
```

```
$ ruby -v benchmark.rb
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
Warming up --------------------------------------
                  +@   282.289k i/100ms
                 dup   187.638k i/100ms
Calculating -------------------------------------
                  +@      6.775M (± 3.6%) i/s -     33.875M in   5.006253s
                 dup      3.320M (± 2.2%) i/s -     16.700M in   5.032125s

Comparison:
                  +@:  6775299.3 i/s
                 dup:  3320400.7 i/s - 2.04x  slower

```
2018-09-23 08:56:55 +09:00
..
tags Enable Start/EndWith and RegexpMatch cops 2018-07-28 17:37:17 -04:00
active_model_helper.rb Fix field_error_proc wrap form select optgroup and divider option tag 2017-11-09 17:37:06 +01:00
asset_tag_helper.rb Fix unclosed tags [ci skip] 2018-08-18 16:23:20 +09:00
asset_url_helper.rb [ci skip] Change references from Rake task to Rails command 2018-08-01 22:44:53 +02:00
atom_feed_helper.rb Fix broken doc layout for action_view [ci skip] 2017-08-27 09:12:19 +09:00
cache_helper.rb Move digest path calculation out of loop 2018-09-11 16:52:44 -05:00
capture_helper.rb [ci skip] Doc ActionView::OutputBuffer 2018-09-06 15:28:45 -05:00
controller_helper.rb Fix broken doc layout for action_view [ci skip] 2017-08-27 09:12:19 +09:00
csp_helper.rb Add support for automatic nonce generation for Rails UJS 2018-02-19 15:59:34 +00:00
csrf_helper.rb Fix broken doc layout for action_view [ci skip] 2017-08-27 09:12:19 +09:00
date_helper.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
debug_helper.rb We should call methods with .method_name not ::method_name. 2018-02-22 00:54:40 +01:00
form_helper.rb Add :namespace option to the api docs of form_with [ci skip] 2018-08-27 15:40:09 +03:00
form_options_helper.rb Merge pull request #33547 from Ana06/patch-1 2018-08-23 00:08:35 +09:30
form_tag_helper.rb Inclusive Language in Documentation Examples [ci skip] 2018-04-15 12:34:30 -04:00
javascript_helper.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
number_helper.rb Add missing documentation options to number_to_currency [ci skip] 2018-07-11 20:59:51 -03:00
output_safety_helper.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
rendering_helper.rb Remove reference to old :text rendering option 2018-05-11 14:19:29 -04:00
sanitize_helper.rb Permit list usage cleanup and clearer documentation 2018-08-27 09:51:46 -04:00
tag_helper.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
tags.rb Fix broken doc layout for action_view [ci skip] 2017-08-27 09:12:19 +09:00
text_helper.rb Enable Style/ParenthesesAroundCondition cop 2018-08-19 08:16:21 +09:00
translation_helper.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
url_helper.rb Fix issue with button_to's to_form_params 2018-07-16 09:44:22 +03:00