aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2012-12-12 00:48:13 +0000
committerNick Burch <nick@apache.org>2012-12-12 00:48:13 +0000
commitb290b1bce2e1f7525565e30942fdd4b755340124 (patch)
treea899f0e5652363bd463a98634ccbdefa60a632fc
parent70417046182e98f62316be6ad3a6f9bfce51e640 (diff)
downloadpoi-b290b1bce2e1f7525565e30942fdd4b755340124.tar.gz
poi-b290b1bce2e1f7525565e30942fdd4b755340124.zip
Patch from Jan from bug #54282 - Improve the performance of ColumnHelper addCleanColIntoCols, speeds up some .xlsx file loading
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1420501 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/documentation/content/xdocs/status.xml1
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml
index b8b3e81d21..8fef9acb23 100644
--- a/src/documentation/content/xdocs/status.xml
+++ b/src/documentation/content/xdocs/status.xml
@@ -34,6 +34,7 @@
<changes>
<release version="4.0-beta1" date="2013-??-??">
+ <action dev="poi-developers" type="fix">54282 - Improve the performance of ColumnHelper addCleanColIntoCols, speeds up some .xlsx file loading</action>
<action dev="poi-developers" type="fix">53650 - Prevent unreadable content and disalow to overwrite rows from input template in SXSSF</action>
<action dev="poi-developers" type="fix">54228,53672 - Fixed XSSF to read cells with missing R attribute</action>
<action dev="poi-developers" type="fix">54206 - Ensure that shared formuals are updated when shifting rows in a spreadsheet</action>
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java
index 3655affc44..46ca2f6737 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java
@@ -112,7 +112,8 @@ public class ColumnHelper {
public CTCols addCleanColIntoCols(CTCols cols, CTCol col) {
boolean colOverlaps = false;
- for (int i = 0; i < cols.sizeOfColArray(); i++) {
+ int sizeOfColArray = cols.sizeOfColArray();
+ for (int i = 0; i < sizeOfColArray; i++) {
CTCol ithCol = cols.getColArray(i);
long[] range1 = { ithCol.getMin(), ithCol.getMax() };
long[] range2 = { col.getMin(), col.getMax() };