Removing unnecessary call to ArraySet#toArray
Iterating over ArraySet using iterators is still more efficient than first calling ArraySet#toArray and then iterating over the array. Test: Minor optimization. make and existing tests should suffice. Change-Id: Ifc282bfca98cf89b047dddddd78a6de020f27381
This commit is contained in:
@@ -2893,7 +2893,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
|
||||
private void ensureUnknownSourcesRestrictionForProfileOwners() {
|
||||
synchronized (this) {
|
||||
for (int userId : mOwners.getProfileOwnerKeys().toArray(new Integer[0])) {
|
||||
for (int userId : mOwners.getProfileOwnerKeys()) {
|
||||
if (!mUserManager.isManagedProfile(userId) ||
|
||||
Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||
Settings.Secure.UNKNOWN_SOURCES_DEFAULT_REVERSED, 0, userId) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user