Browse Source

Merge pull request #589 from xxb-at-julichina/master

Reduce redundant memory copy in getRowHeight
xuri 5 years ago
parent
commit
0ac7e18389
1 changed files with 2 additions and 1 deletions
  1. 2 1
      rows.go

+ 2 - 1
rows.go

@@ -238,7 +238,8 @@ func (f *File) SetRowHeight(sheet string, row int, height float64) error {
 // name and row index.
 // name and row index.
 func (f *File) getRowHeight(sheet string, row int) int {
 func (f *File) getRowHeight(sheet string, row int) int {
 	xlsx, _ := f.workSheetReader(sheet)
 	xlsx, _ := f.workSheetReader(sheet)
-	for _, v := range xlsx.SheetData.Row {
+	for i := range xlsx.SheetData.Row {
+		v := &xlsx.SheetData.Row[i]
 		if v.R == row+1 && v.Ht != 0 {
 		if v.R == row+1 && v.Ht != 0 {
 			return int(convertRowHeightToPixels(v.Ht))
 			return int(convertRowHeightToPixels(v.Ht))
 		}
 		}