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

Commit c5b2de9d authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Do not run unnecessary code in the common case

`processes` is initialized as an empty map, so we're currently always
hitting the loop case. We should avoid it.

Bug: 213021110
Test: atest PackageManagerPerfTest#testGetApplicationInfoWithFiltering
Test: atest CtsProcessTest
Test: atest PackageManagerServiceUnitTests
Change-Id: I49fa8adb0cf10e405b2251e7de78caea1bbd8fa1
parent 2edc6b83
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1152,7 +1152,7 @@ public class ParsingPackageImpl implements ParsingPackage, ParsingPackageHidden,
     */
    @Nullable
    private ArrayMap<String, String> buildAppClassNamesByProcess() {
        if (processes == null) {
        if (ArrayUtils.size(processes) == 0) {
            return null;
        }
        final ArrayMap<String, String> ret = new ArrayMap<>(4);