mirror of
https://github.com/meineerde/rackstash.git
synced 2025-10-17 14:01:01 +00:00
With this, we optimize the common case where we do have valid UTF-8 strings to begin with. If the given String is already frozen, as is common for e.g. Hash keys, we don't even need to create a new object. With this change, we also always return frozen strings from `Rackstash::Fields::AbstractCollection#utf9_encode`. This avoids an unecessary object copy when inserting it in a Hash and still ensures that values are always frozen anyway.