未验证 提交 3e636ae7 编写于 作者: N Nima 提交者: GitHub

This closes #1874, reduces memory usage for the GetRows function (#1875)

- Avoid allocate memory for reading continuously empty rows on the tail of the worksheet
上级 5f8a5b86
......@@ -70,8 +70,11 @@ func (f *File) GetRows(sheet string, opts ...Options) ([][]string, error) {
if err != nil {
break
}
results = append(results, row)
if len(row) > 0 {
if emptyRows := cur - maxVal - 1; emptyRows > 0 {
results = append(results, make([][]string, emptyRows)...)
}
results = append(results, row)
maxVal = cur
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册