diff options
| author | Geremia Taglialatela <[email protected]> | 2023-05-17 11:05:45 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-17 11:06:28 +0200 |
| commit | a8d93e0f5163fba23e6f7b5213b8d67d2dd30e6d (patch) | |
| tree | 039f6f5a3c4bdac5c048710b2362aa6bac22b231 /lib/axlsx | |
| parent | 7051298d8cb76b9fe7b35d614332f50bc38f8ef2 (diff) | |
| download | caxlsx-a8d93e0f5163fba23e6f7b5213b8d67d2dd30e6d.tar.gz caxlsx-a8d93e0f5163fba23e6f7b5213b8d67d2dd30e6d.zip | |
Fix safe performance RuboCop offenses
- Fix Performance/RedundantMatch and Performance/RegexpMatch
- Fix Performance/RedundantSplitRegexpArgument
Diffstat (limited to 'lib/axlsx')
| -rw-r--r-- | lib/axlsx/stylesheet/color.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/sheet_protection.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/stylesheet/color.rb b/lib/axlsx/stylesheet/color.rb index 47617da5..87308bb1 100644 --- a/lib/axlsx/stylesheet/color.rb +++ b/lib/axlsx/stylesheet/color.rb @@ -55,7 +55,7 @@ module Axlsx v = v.upcase v = v * 3 if v.size == 2 v = v.rjust(8, 'FF') - raise ArgumentError, "Invalid color rgb value: #{v}." unless v.match(/[0-9A-F]{8}/) + raise ArgumentError, "Invalid color rgb value: #{v}." unless /[0-9A-F]{8}/.match?(v) @rgb = v end diff --git a/lib/axlsx/workbook/worksheet/sheet_protection.rb b/lib/axlsx/workbook/worksheet/sheet_protection.rb index faf34f97..e506f8d9 100644 --- a/lib/axlsx/workbook/worksheet/sheet_protection.rb +++ b/lib/axlsx/workbook/worksheet/sheet_protection.rb @@ -98,7 +98,7 @@ module Axlsx # @return [String] def encode_password(password) i = 0 - chars = password.split(//) + chars = password.split("") count = chars.size chars.collect! do |char| |
