Author: fanningpj
Date: Mon Feb 14 20:23:56 2022
New Revision: 1898086

URL: http://svn.apache.org/viewvc?rev=1898086&view=rev
Log:
minor perf issue

Modified:
    poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java

Modified: 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java?rev=1898086&r1=1898085&r2=1898086&view=diff
==============================================================================
--- 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java 
(original)
+++ 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java 
Mon Feb 14 20:23:56 2022
@@ -626,10 +626,11 @@ public class XSSFRow implements Row, Com
      * @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);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to