Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use transform_values to build hash_rows
This commit changes hash_rows to build the first row as it did before, and then to use transform_values to build subsequent rows, using the first as a template. In Ruby 2.4+ (first version to include transform_values) this is marginally faster because the hash will never be realloc'd and the hash update logic is probably slightly simpler than add. In Ruby 2.7+ this is a fair bit faster because transform_values is able to run without hashing the keys and only iterates over the values list. In the case that we only have one row this is only one extra lvar set/read and the condition.
- Loading branch information