From bf9a8355494eac18812f3caf6d469962824f627f Mon Sep 17 00:00:00 2001 From: Harris Date: Mon, 28 Oct 2019 10:34:21 -0500 Subject: Reduce allocations when writing Fix #494 If a row is full, don't bother allocating a new one, just return it. Use the last populated row as a hint for the size of new rows. Simplify checkSheet to remove row map --- xmlWorksheet.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xmlWorksheet.go') diff --git a/xmlWorksheet.go b/xmlWorksheet.go index 96ca235..8408cfa 100644 --- a/xmlWorksheet.go +++ b/xmlWorksheet.go @@ -430,6 +430,10 @@ type xlsxC struct { XMLSpace xml.Attr `xml:"space,attr,omitempty"` } +func (c *xlsxC) hasValue() bool { + return c.S != 0 || c.V != "" || c.F != nil || c.T != "" +} + // xlsxF directly maps the f element in the namespace // http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have // not checked it for completeness - it does as much as I need. -- cgit v1.2.1