]> source.dussan.org Git - poi.git/commitdiff
write for loop for performance and readability
authorJaven O'Neal <onealj@apache.org>
Mon, 28 Dec 2015 14:20:30 +0000 (14:20 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 28 Dec 2015 14:20:30 +0000 (14:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1721924 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java

index eb439bc4761d8295f3fafc542e1890e193480449..b02ac2713ff260b22c8f1739dde6af53216b1392 100644 (file)
@@ -1020,11 +1020,9 @@ public class TestXSSFCellStyle {
 
     public static void copyStyles(Workbook reference, Workbook target) {
         final short numberOfStyles = reference.getNumCellStyles();
-        for (short i = 0; i < numberOfStyles; i++) {
+        // don't copy default style (style index 0)
+        for (short i = 1; i < numberOfStyles; i++) {
             final CellStyle referenceStyle = reference.getCellStyleAt(i);
-            if (i == 0) {
-                continue;
-            }
             final CellStyle targetStyle = target.createCellStyle();
             targetStyle.cloneStyleFrom(referenceStyle);
         }