From 53ffe2504f1a5cba28a01a18c359bd7e6527fe44 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 11 Jun 2023 00:32:12 +0900 Subject: [PATCH] Remove a redundant `Symbol#to_s` Follow up #11791. RuboCop runtime supports only Ruby >= 2.7, so it removes a redundant `Symbol#to_s`. --- lib/rubocop/cop/metrics/utils/abc_size_calculator.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb b/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb index ef58175891ad..eb828c5d3ac9 100644 --- a/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +++ b/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb @@ -117,8 +117,7 @@ def simple_assignment?(node) end def capturing_variable?(name) - # TODO: Remove `Symbol#to_s` after supporting only Ruby >= 2.7. - name && !name.to_s.start_with?('_') + name && !name.start_with?('_') end def branch?(node)