Skip to content

Commit

Permalink
Freeze constants, not the array they're splat from
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Jan 20, 2023
1 parent 4caa46d commit 9c30838
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/fugit/duration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ def common_rewrite_dur(t)
hou: { a: 'h', r: 'h', i: 'H', s: 3600, I: true, l: 'hour' },
min: { a: 'm', r: 'm', i: 'M', s: 60, I: true, l: 'minute' },
sec: { a: 's', r: 's', i: 'S', s: 1, I: true, l: 'second' } }.freeze
INFLA_KEYS, NON_INFLA_KEYS =
KEYS.partition { |k, v| v[:I] }.freeze

INFLA_KEYS, NON_INFLA_KEYS = KEYS
.partition { |k, v| v[:I] }
.collect(&:freeze)

def _to_s(key)

Expand Down

0 comments on commit 9c30838

Please sign in to comment.