Tiny performance improve
Tiny performance improve

in this case we can use bang method

require 'benchmark/ips'
Benchmark.ips do |x|
  def test1
    {:headers => 'test', write_headers: true}.merge(:col_sep => ';')
  end

  def test2
    {:headers => 'test', write_headers: true}.merge!(:col_sep => ';')
  end

  x.report('test1') { test1 }
  x.report('test2') { test2 }

  x.compare!
end

Calculating -------------------------------------
               test1    53.437k i/100ms
               test2    75.371k i/100ms
-------------------------------------------------
               test1    810.729k (± 2.3%) i/s -      4.061M
               test2      1.466M (± 2.9%) i/s -      7.386M

Comparison:
               test2:  1465705.3 i/s
               test1:   810728.8 i/s - 1.81x slower

bogdan/datagrid,reenhanced/datagrid,artofhuman/datagrid,jeanlinux/datagrid,jeanlinux/datagrid,bogdan/datagrid,reenhanced/datagrid,artofhuman/datagrid,sadaf2605/datagrid,sadaf2605/datagrid