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

Commit 3dea1c79 authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

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
parent 2e7d6d64
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {