You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2022/02/14 20:23:56 UTC

svn commit: r1898086 - /poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java

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: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org