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

Commit 09ae4931 authored by Tobias Thierer's avatar Tobias Thierer Committed by Gerrit Code Review
Browse files

Merge "frameworks/base: Avoid Long object allocations in Long.valueOf()"

parents c027ae49 4bd017d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -527,7 +527,7 @@ public class Am extends BaseCommand {
                String[] strings = value.split(",");
                long[] list = new long[strings.length];
                for (int i = 0; i < strings.length; i++) {
                    list[i] = Long.valueOf(strings[i]);
                    list[i] = Long.parseLong(strings[i]);
                }
                intent.putExtra(key, list);
                hasIntentInfo = true;
+3 −3
Original line number Diff line number Diff line
@@ -128,15 +128,15 @@ public class RequestSync {
            } else if (opt.equals("--el") || opt.equals("--extra-long")) {
                final String key = nextArgRequired();
                final String value = nextArgRequired();
                mExtras.putLong(key, Long.valueOf(value));
                mExtras.putLong(key, Long.parseLong(value));
            } else if (opt.equals("--ef") || opt.equals("--extra-float")) {
                final String key = nextArgRequired();
                final String value = nextArgRequired();
                mExtras.putFloat(key, Long.valueOf(value));
                mExtras.putFloat(key, Long.parseLong(value));
            } else if (opt.equals("--ed") || opt.equals("--extra-double")) {
                final String key = nextArgRequired();
                final String value = nextArgRequired();
                mExtras.putFloat(key, Long.valueOf(value));
                mExtras.putFloat(key, Long.parseLong(value));
            } else if (opt.equals("--ez") || opt.equals("--extra-bool")) {
                final String key = nextArgRequired();
                final String value = nextArgRequired();
+1 −1
Original line number Diff line number Diff line
@@ -453,7 +453,7 @@ public final class NfcFCardEmulation {
            return false;
        }
        try {
            Long.valueOf(nfcid2, 16);
            Long.parseLong(nfcid2, 16);
        } catch (NumberFormatException e) {
            Log.e(TAG, "NFCID2 " + nfcid2 + " is not a valid NFCID2.");
            return false;
+1 −1
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ public class ZenModeConfig implements Parcelable {
    private static long tryParseLong(String value, long defValue) {
        if (TextUtils.isEmpty(value)) return defValue;
        try {
            return Long.valueOf(value);
            return Long.parseLong(value);
        } catch (NumberFormatException e) {
            return defValue;
        }
+1 −1
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ public class ExifInterface {
            String subSecs = mAttributes.get(TAG_SUBSECTIME);
            if (subSecs != null) {
                try {
                    long sub = Long.valueOf(subSecs);
                    long sub = Long.parseLong(subSecs);
                    while (sub > 1000) {
                        sub /= 10;
                    }
Loading