ulid-ruby
ulid-ruby copied to clipboard
Use Enumerable#to_h to avoid extra allocation
We can avoid extra allocation by directly calling #to_h on ENCODING.split('').each_with_index instead of first converting it to an array and then converting it to a hash.
This is not a Hot path for this library as constants are generated only on load. Please feel free to close the PR if this qualifies as a cosmetic change.