Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5427aff4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Keystore 2.0 SPI: Add forEach for int arrays to ArrayUtils" am: 47e0d9e3 am: 7afe8663

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1470092

Change-Id: I410f60138361e46fe9b333da9759549efe7fbb85
parents 21604689 7afe8663
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package android.security.keystore;

import libcore.util.EmptyArray;

import java.util.function.Consumer;

/**
 * @hide
 */
@@ -107,4 +109,16 @@ public abstract class ArrayUtils {
            return result;
        }
    }

    /**
     * Runs {@code consumer.accept()} for each element of {@code array}.
     * @param array
     * @param consumer
     * @hide
     */
    public static void forEach(int[] array, Consumer<Integer> consumer) {
        for (int i : array) {
            consumer.accept(i);
        }
    }
}