You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/11/21 17:47:12 UTC

[commons-codec] branch master updated: Use for-each.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git


The following commit(s) were added to refs/heads/master by this push:
     new 889d94f  Use for-each.
889d94f is described below

commit 889d94fab06e26d5023d8709e4a4696a266491bd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 21 12:47:08 2020 -0500

    Use for-each.
---
 src/main/java/org/apache/commons/codec/binary/Base64.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/codec/binary/Base64.java b/src/main/java/org/apache/commons/codec/binary/Base64.java
index 751b84e..6cb49ab 100644
--- a/src/main/java/org/apache/commons/codec/binary/Base64.java
+++ b/src/main/java/org/apache/commons/codec/binary/Base64.java
@@ -358,8 +358,8 @@ public class Base64 extends BaseNCodec {
      * @since 1.5
      */
     public static boolean isBase64(final byte[] arrayOctet) {
-        for (int i = 0; i < arrayOctet.length; i++) {
-            if (!isBase64(arrayOctet[i]) && !isWhiteSpace(arrayOctet[i])) {
+        for (byte element : arrayOctet) {
+            if (!isBase64(element) && !isWhiteSpace(element)) {
                 return false;
             }
         }