~cytrogen/masto-fe

0664704cd94a356b07870d63971ba11a07d24894 — Matt Jankowski 2 years ago 9a472ef
Fix Performance/StartWith cop (#24818)

2 files changed, 1 insertions(+), 7 deletions(-)

M .rubocop_todo.yml
M app/lib/extractor.rb
M .rubocop_todo.yml => .rubocop_todo.yml +0 -6
@@ 256,12 256,6 @@ Performance/MapCompact:
    - 'spec/presenters/status_relationships_presenter_spec.rb'

# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SafeMultiline.
Performance/StartWith:
  Exclude:
    - 'app/lib/extractor.rb'

# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/UnfreezeString:
  Exclude:
    - 'app/lib/rss/builder.rb'

M app/lib/extractor.rb => app/lib/extractor.rb +1 -1
@@ 64,7 64,7 @@ module Extractor
      end_position   = match_data.char_end(1)
      after          = ::Regexp.last_match.post_match

      if %r{\A://}.match?(after)
      if after.start_with?('://')
        hash_text.match(/(.+)(https?\Z)/) do |matched|
          hash_text     = matched[1]
          end_position -= matched[2].codepoint_length