summaryrefslogtreecommitdiff
path: root/rows.go
diff options
context:
space:
mode:
authorHarris <mike.harris@cerner.com>2019-08-06 16:43:56 -0500
committerHarris <mike.harris@cerner.com>2019-08-07 08:06:40 -0500
commite07581e980444b64bc15fce328ff07736ac9dbf6 (patch)
tree50db71365960a81bd46f72818704a562dd5f69d3 /rows.go
parent3599b24c9594acaa8449d38745993d8be29c6af9 (diff)
Further improve read performance
Instead of re-encoding the full sheet to change the namespaces in the encoded bytes, read the sheet again and do the byte replacements there. In this case, file access ends up being more performant than marshaling the sheet back to XML. In the SharedStrings test, ensure the strings are actually read. Fix #439
Diffstat (limited to 'rows.go')
-rw-r--r--rows.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/rows.go b/rows.go
index cb0e31f..220c233 100644
--- a/rows.go
+++ b/rows.go
@@ -112,8 +112,8 @@ func (f *File) Rows(sheet string) (*Rows, error) {
return nil, ErrSheetNotExist{sheet}
}
if xlsx != nil {
- output, _ := xml.Marshal(f.Sheet[name])
- f.saveFileList(name, replaceWorkSheetsRelationshipsNameSpaceBytes(output))
+ data := f.readXML(name)
+ f.saveFileList(name, replaceWorkSheetsRelationshipsNameSpaceBytes(namespaceStrictToTransitional(data)))
}
return &Rows{
f: f,