プロジェクト

全般

プロフィール

Vote #81105

完了

Use match? instead of =~ when MatchData is not used

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Performance_53
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
53
version_id:
152
issue_org_id:
34150
author_id:
332
assigned_to_id:
332
comments:
3
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

@String#match?@ was added in Ruby 2.4. you can replace @=~@ with faster @String#match?@ or @Regexp#match?@ when MatchData generated by =~ is not necessary.

The attached patch changes such @=~@ to @mach?@. I generated the patch with the following commands.

sed -i '' 's/TargetRubyVersion: 2.3/TargetRubyVersion: 2.4/' .rubocop.yml 
bundle exec rubocop --only Performance/RegexpMatch -a

journals

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed the patch.
--------------------------------------------------------------------------------


related_issues

relates,Closed,34142,Drop Ruby 2.3 support
blocks,Closed,32530,Update RuboCop to 1.12

Admin Redmine さんが約4年前に更新

  • カテゴリPerformance_53 にセット
  • 対象バージョン4.2.0_152 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0