minor perf issue

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898086 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-02-14 20:23:56 +00:00
parent 7dbfc41dfb
commit 068cd83970
1 changed files with 4 additions and 3 deletions

View File

@ -626,10 +626,11 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
* @param n the number of rows to move
*/
protected void shift(int n) {
int rownum = getRowNum() + n;
String msg = "Row[rownum=" + getRowNum() + "] contains cell(s) included in a multi-cell array formula. " +
final int rownum = getRowNum();
final int newRownum = rownum + n;
String msg = "Row[rownum=" + rownum + "] contains cell(s) included in a multi-cell array formula. " +
"You cannot change part of an array.";
setRowNum(rownum);
setRowNum(newRownum);
for(Cell c : this){
((XSSFCell)c).updateCellReferencesForShifting(msg);
}