summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
authorTed <37789839+Theodoree@users.noreply.github.com>2020-11-03 17:48:37 +0800
committerGitHub <noreply@github.com>2020-11-03 17:48:37 +0800
commitfcca8a38389c7a7f99639dc142b9b10c827ac7ce (patch)
treeaa0e2f264153a793f1157c23959a9c140fa1bf67 /lib.go
parent9d470bb38f992d9f0da2168b7a576f9e212b7a88 (diff)
optimize memory allocation (#722)
* optimize marshal * optimize mem alloc * add benchmark testing * add NewSheetWithRowNum testing * sync struct fields order * add BenchmarkNewSheetWithStreamWriter * delete NewSheetWithRowNum and benchmark test
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib.go b/lib.go
index 88aa3a1..7dcc09e 100644
--- a/lib.go
+++ b/lib.go
@@ -206,8 +206,9 @@ func CoordinatesToCellName(col, row int) (string, error) {
if col < 1 || row < 1 {
return "", fmt.Errorf("invalid cell coordinates [%d, %d]", col, row)
}
+ //Using itoa will save more memory
colname, err := ColumnNumberToName(col)
- return fmt.Sprintf("%s%d", colname, row), err
+ return colname + strconv.Itoa(row), err
}
// boolPtr returns a pointer to a bool with the given value.