summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/stylesheet/styles.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-06-02 20:55:14 +0200
committerGeremia Taglialatela <[email protected]>2023-06-02 20:55:14 +0200
commit4195130bb4633bc667aeedd297dc56d7632a5810 (patch)
tree58a96dd864cc81c66c14499b6b6de40dbcd1d936 /lib/axlsx/stylesheet/styles.rb
parentad87c51bf8c8f59a36514bb95dc6d3a582c6b2fd (diff)
downloadcaxlsx-4195130bb4633bc667aeedd297dc56d7632a5810.tar.gz
caxlsx-4195130bb4633bc667aeedd297dc56d7632a5810.zip
Fix negated if offenses
Should also provide a negligible performance improvement, about 3% on Ruby 3.2 and 6% on Ruby 2.6 (M1 Pro)
Diffstat (limited to 'lib/axlsx/stylesheet/styles.rb')
-rw-r--r--lib/axlsx/stylesheet/styles.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb
index e518d21e..6356d9e6 100644
--- a/lib/axlsx/stylesheet/styles.rb
+++ b/lib/axlsx/stylesheet/styles.rb
@@ -381,7 +381,7 @@ module Axlsx
end
validate_border_hash = ->(val) {
- if !(val.key?(:style) && val.key?(:color))
+ unless val.key?(:style) && val.key?(:color)
raise ArgumentError, (ERR_INVALID_BORDER_OPTIONS % options[:border])
end
}
@@ -439,7 +439,7 @@ module Axlsx
next
end
- if !edge_b_opts.empty?
+ unless edge_b_opts.empty?
if base_border_opts.empty?
validate_border_hash.call(edge_b_opts)
end