diff options
| author | ochko <[email protected]> | 2012-03-26 20:05:48 +0900 |
|---|---|---|
| committer | ochko <[email protected]> | 2012-03-26 20:05:48 +0900 |
| commit | f6c3a491ef014914524a98259a8679a5e4f64d57 (patch) | |
| tree | 1fc548ff843cbce5e06db0c6133407f503d3e78c /lib/axlsx/workbook/worksheet/row.rb | |
| parent | 1c2ec07135a46bd042528c5bc6e5e37b563b6c6e (diff) | |
| download | caxlsx-f6c3a491ef014914524a98259a8679a5e4f64d57.tar.gz caxlsx-f6c3a491ef014914524a98259a8679a5e4f64d57.zip | |
use Array#join instead of concatenating
(got 1 sec speed improvement for 1000 cells)
Diffstat (limited to 'lib/axlsx/workbook/worksheet/row.rb')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/row.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/row.rb b/lib/axlsx/workbook/worksheet/row.rb index db7a56e5..cec2eb25 100644 --- a/lib/axlsx/workbook/worksheet/row.rb +++ b/lib/axlsx/workbook/worksheet/row.rb @@ -63,7 +63,7 @@ module Axlsx if custom_height? "<row r=\"%s\" customHeight=\"1\" ht=\"%s\">%s</row>" % [index+1, height, @cells.inject("") { |memo, obj| obj.to_xml_string }] else - "<row r=\"%s\">%s</row>" % [index+1, @cells.inject("") { |memo, obj| memo.concat obj.to_xml_string }] + "<row r=\"%s\">%s</row>" % [index+1, @cells.map{ |obj| obj.to_xml_string }.join] end end # Serializes the row |
