diff options
| author | Paul Kmiec <[email protected]> | 2023-05-13 09:55:49 -0700 |
|---|---|---|
| committer | Paul Kmiec <[email protected]> | 2023-05-15 16:58:24 -0700 |
| commit | e57d67b31d0edbdf3ffe1f2e16f1c262e1b48c4b (patch) | |
| tree | f5e89107e3b47d6d39b35c73a1dbfa267b80b570 /lib | |
| parent | d18d7f9696211a0ed899153ce4d8ae9cb9c15b6d (diff) | |
| download | caxlsx-e57d67b31d0edbdf3ffe1f2e16f1c262e1b48c4b.tar.gz caxlsx-e57d67b31d0edbdf3ffe1f2e16f1c262e1b48c4b.zip | |
Using `between?` is more efficient than `cover?`
Co-authored-by: Geremia Taglialatela <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 37b8e205..10818f5c 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -511,7 +511,7 @@ module Axlsx :boolean elsif v.respond_to?(:to_i) && v.to_s =~ Axlsx::NUMERIC_REGEX :integer - elsif v.respond_to?(:to_f) && (v.to_s =~ Axlsx::SAFE_FLOAT_REGEX || ((matchdata = v.to_s.match(MAYBE_FLOAT_REGEX)) && (Float::MIN_10_EXP..Float::MAX_10_EXP).cover?(matchdata[:exp].to_i))) + elsif v.respond_to?(:to_f) && (v.to_s =~ Axlsx::SAFE_FLOAT_REGEX || ((matchdata = v.to_s.match(MAYBE_FLOAT_REGEX)) && matchdata[:exp].to_i.between?(Float::MIN_10_EXP, Float::MAX_10_EXP))) :float elsif Axlsx::ISO_8601_REGEX.match?(v.to_s) :iso_8601 |
