diff options
| author | Geremia Taglialatela <[email protected]> | 2023-05-10 17:25:51 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-10 17:25:51 +0200 |
| commit | 7139d6252ad775ea9b6ffe2b2372e86c1c825401 (patch) | |
| tree | 1402fc2368cf9245459db84b1c6700ad0ce6f971 /lib/axlsx/drawing/axes.rb | |
| parent | 67d8a1a781e53761a483575cc5abc7e9a992d2ca (diff) | |
| download | caxlsx-7139d6252ad775ea9b6ffe2b2372e86c1c825401.tar.gz caxlsx-7139d6252ad775ea9b6ffe2b2372e86c1c825401.zip | |
Fix Inefficient Hash Search offenses
Use `key?` instead of `keys.include?` to improve performance
Diffstat (limited to 'lib/axlsx/drawing/axes.rb')
| -rw-r--r-- | lib/axlsx/drawing/axes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/drawing/axes.rb b/lib/axlsx/drawing/axes.rb index eb4728c6..6a74c879 100644 --- a/lib/axlsx/drawing/axes.rb +++ b/lib/axlsx/drawing/axes.rb @@ -9,7 +9,7 @@ module Axlsx # class of the axis type to construct. The :cat_axis, if there is one, # must come first (we assume a Ruby 1.9+ Hash or an OrderedHash). def initialize(options = {}) - raise(ArgumentError, "CatAxis must come first") if options.keys.include?(:cat_axis) && options.keys.first != :cat_axis + raise(ArgumentError, "CatAxis must come first") if options.key?(:cat_axis) && options.keys.first != :cat_axis options.each do |name, axis_class| add_axis(name, axis_class) |
