]> source.dussan.org Git - poi.git/commitdiff
[github-351] make test loop more efficient
authorPJ Fanning <fanningpj@apache.org>
Fri, 15 Jul 2022 21:24:53 +0000 (21:24 +0000)
committerPJ Fanning <fanningpj@apache.org>
Fri, 15 Jul 2022 21:24:53 +0000 (21:24 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902752 13f79535-47bb-0310-9956-ffa450edef68

poi-scratchpad/src/test/java/org/apache/poi/hdgf/streams/TestStreamComplex.java

index f4e9efe3c7a8ee85ecae0c2c89f4aacb93dfd940..f826392d7ad7a1778052f140cb008c3bd23a7e03 100644 (file)
@@ -254,8 +254,8 @@ public final class TestStreamComplex extends StreamTest {
 
         // One of which is Text
         boolean hasText = false;
-        for(int i=0; i<cs.getChunks().length; i++) {
-            if(cs.getChunks()[i].getName().equals("Text")) {
+        for(int i = 0; !hasText && i < cs.getChunks().length; i++) {
+            if (cs.getChunks()[i].getName().equals("Text")) {
                 hasText = true;
             }
         }