lib/rubocop/cop/performance/start_with.rb in rubocop-performance-1.14.3 vs lib/rubocop/cop/performance/start_with.rb in rubocop-performance-1.15.0
- old
+ new
@@ -48,11 +48,10 @@
#
class StartWith < Base
include RegexpMetacharacter
extend AutoCorrector
- MSG = 'Use `String#start_with?` instead of a regex match anchored to ' \
- 'the beginning of the string.'
+ MSG = 'Use `String#start_with?` instead of a regex match anchored to the beginning of the string.'
RESTRICT_ON_SEND = %i[match =~ match?].freeze
def_node_matcher :redundant_regex?, <<~PATTERN
{(send $!nil? {:match :=~ :match?} (regexp (str $#literal_at_start?) (regopt)))
(send (regexp (str $#literal_at_start?) (regopt)) {:match :match?} $_)