mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Freeze columns before using them as hash keys
This reduces the number of allocated strings from columns * (rows + 1) to just columns.
This commit is contained in:
parent
0247443deb
commit
3aef5ce9b3
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ module ActiveRecord
|
||||||
attr_reader :columns, :rows, :column_types
|
attr_reader :columns, :rows, :column_types
|
||||||
|
|
||||||
def initialize(columns, rows, column_types = {})
|
def initialize(columns, rows, column_types = {})
|
||||||
@columns = columns
|
@columns = columns.map{|c| c.freeze}
|
||||||
@rows = rows
|
@rows = rows
|
||||||
@hash_rows = nil
|
@hash_rows = nil
|
||||||
@column_types = column_types
|
@column_types = column_types
|
||||||
|
|
Loading…
Reference in a new issue