Merge "Keystore 2.0 SPI: Add forEach for int arrays to ArrayUtils" am: 47e0d9e30b am: 7afe866370
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1470092 Change-Id: I410f60138361e46fe9b333da9759549efe7fbb85
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user