Merge "Keystore 2.0 SPI: Add forEach for int arrays to ArrayUtils" am: 47e0d9e30b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1470092 Change-Id: I69695bb8ae5e276178fc645bc0d6dfeea27107f1
This commit is contained in:
@@ -18,6 +18,8 @@ package android.security.keystore;
|
|||||||
|
|
||||||
import libcore.util.EmptyArray;
|
import libcore.util.EmptyArray;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@@ -107,4 +109,16 @@ public abstract class ArrayUtils {
|
|||||||
return result;
|
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