Skip to content

Commit

Permalink
Use empty? instead of size == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Mar 31, 2016
1 parent e00009e commit e00007b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions .rubocop_todo.yml
Expand Up @@ -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'
4 changes: 2 additions & 2 deletions benchmarks/lib/cli_parser.rb
Expand Up @@ -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.'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e00007b

Please sign in to comment.