mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-23 21:15:05 +01:00
Fix Performance/StartWith cop (#24818)
This commit is contained in:
parent
9a472efe7c
commit
0664704cd9
@ -255,12 +255,6 @@ Performance/MapCompact:
|
||||
- 'db/migrate/20200407202420_migrate_unavailable_inboxes.rb'
|
||||
- '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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user