From e00007b315158eadab53f0b9ae589986b973f1c3 Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Mon, 21 Mar 2016 14:42:50 -0700 Subject: [PATCH] Use empty? instead of size == 0 --- .rubocop_todo.yml | 5 ----- benchmarks/lib/cli_parser.rb | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 68348921..d5ae3670 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -34,8 +34,3 @@ Style/CommentAnnotation: Exclude: - 'benchmarks/lib/cli_parser.rb' - 'lib/activerecord-import/import.rb' - -# Offense count: 2 -Style/ZeroLengthPredicate: - Exclude: - - 'benchmarks/lib/cli_parser.rb' diff --git a/benchmarks/lib/cli_parser.rb b/benchmarks/lib/cli_parser.rb index 08d8f8cb..3e01645a 100644 --- a/benchmarks/lib/cli_parser.rb +++ b/benchmarks/lib/cli_parser.rb @@ -29,7 +29,7 @@ def self.print_options( options ) # TODO IMPLEMENT THIS def self.print_valid_table_types( options, hsh = { prefix: '' } ) - if options.table_types.keys.size > 0 + if !options.table_types.keys.empty? options.table_types.keys.sort.each { |type| puts hsh[:prefix].to_s + type.to_s } else puts 'No table types defined.' @@ -89,7 +89,7 @@ def self.parse( args ) begin opt_parser.parse!( args ) - if options.table_types.size == 0 + if options.table_types.empty? options.table_types['all'] = options.benchmark_all_types = true end rescue Exception