From fcca8a38389c7a7f99639dc142b9b10c827ac7ce Mon Sep 17 00:00:00 2001 From: Ted <37789839+Theodoree@users.noreply.github.com> Date: Tue, 3 Nov 2020 17:48:37 +0800 Subject: 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 --- lib.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib.go') 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. -- cgit v1.2.1