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/d_lbls.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/d_lbls.rb')
| -rw-r--r-- | lib/axlsx/drawing/d_lbls.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/drawing/d_lbls.rb b/lib/axlsx/drawing/d_lbls.rb index 4e2bd40c..29697378 100644 --- a/lib/axlsx/drawing/d_lbls.rb +++ b/lib/axlsx/drawing/d_lbls.rb @@ -76,7 +76,7 @@ module Axlsx str << '<c:dLbls>' instance_vals = Axlsx.instance_values_for(self) %w(d_lbl_pos show_legend_key show_val show_cat_name show_ser_name show_percent show_bubble_size show_leader_lines).each do |key| - next unless instance_vals.keys.include?(key) && instance_vals[key] != nil + next unless instance_vals.key?(key) && instance_vals[key] != nil str << "<c:#{Axlsx::camel(key, false)} val='#{instance_vals[key]}' />" end |
