commit | 358890c4af42839c1f0858c1f2a4782203fbd706 | [log] [tgz] |
---|---|---|
author | Hungming Chen <nuccachen@google.com> | Mon Aug 30 01:34:48 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Aug 30 01:34:48 2021 +0000 |
tree | 0c67f9179da62ed7dc3ac1d6e21925b372e28822 | |
parent | b2a595bc04b17db417f43c22be618e1a0eb542ff [diff] | |
parent | 5318137ac0a2742b8b1e6703446312e9af8f91da [diff] |
Refactor CollectionUtils.contains for short am: 0a51a235b5 am: 8dea957af9 Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1810278 Change-Id: I3b32fa71362372f8b8405f70af2f2ce61c37c05b
diff --git a/staticlibs/framework/com/android/net/module/util/CollectionUtils.java b/staticlibs/framework/com/android/net/module/util/CollectionUtils.java index 9eb2c22..6e1af55 100644 --- a/staticlibs/framework/com/android/net/module/util/CollectionUtils.java +++ b/staticlibs/framework/com/android/net/module/util/CollectionUtils.java
@@ -125,8 +125,8 @@ */ public static boolean contains(@Nullable short[] array, short value) { if (array == null) return false; - for (int i = 0; i < array.length; i++) { - if (array[i] == value) { + for (int element : array) { + if (element == value) { return true; } }