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

Commit fc240dcd authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Tidy up uses of Integer.valueOf.

Use parseInt when the result is assigned to an int. Allocates fewer
objects.

bug: 28078871
Change-Id: I8219141b8a18d2bc575fd75aaa4552e15bd68d1f
parent 13568574
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -432,7 +432,7 @@ public class SmsNumberUtils {

            int[] ccArray = new int[MAX_COUNTRY_CODES_LENGTH];
            for (int i = 0; i < MAX_COUNTRY_CODES_LENGTH; i ++) {
                ccArray[i] = Integer.valueOf(number.substring(0, i+1));
                ccArray[i] = Integer.parseInt(number.substring(0, i+1));
            }

            for (int i = 0; i < allCCs.length; i ++) {
+2 −2
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public class SmsNumberUtilsTest extends TelephonyTest {
                    MatrixCursor mc = new MatrixCursor(
                            new String[]{HbpcdLookup.MccIdd.IDD});

                    switch (Integer.valueOf(selectionArgs[0])) {
                    switch (Integer.parseInt(selectionArgs[0])) {
                        case 310:
                            mc.addRow(new Object[]{"011"}); // US IDD code
                            break;
@@ -77,7 +77,7 @@ public class SmsNumberUtilsTest extends TelephonyTest {
                            mc.addRow(new Object[]{"010"}); // India IDD code
                            break;
                        default:
                            logd("Unhandled MCC" + Integer.valueOf(selectionArgs[0]));
                            logd("Unhandled MCC" + Integer.parseInt(selectionArgs[0]));
                    }

                    return mc;