Bug 1081317: Don't create redundant temporary objects when converting primitives to strings. r=rnewman
authorChris Kitching <chriskitching@linux.com>
Fri, 10 Oct 2014 21:53:22 +0100
changeset 233140 8eb295a430d482bafed4ebdd9c0a4cd2e4a1505a
parent 233139 1b962a92eff2f6f93b173ed5f664b218355c78a1
child 233141 f8ed92864d273b7561aa7dbe1600035f417d5ed9
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1081317
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1081317: Don't create redundant temporary objects when converting primitives to strings. r=rnewman * * * Bug 1081317: Don't create redundant temporary objects when converting primitives to strings. r=rnewman
mobile/android/base/db/PasswordsProvider.java
mobile/android/base/sync/config/ConfigurationMigrator.java
--- a/mobile/android/base/db/PasswordsProvider.java
+++ b/mobile/android/base/db/PasswordsProvider.java
@@ -171,17 +171,17 @@ public class PasswordsProvider extends S
             case PASSWORDS:
                 values.put(Passwords.TIME_CREATED, now);
 
                 // Generate GUID for new password. Don't override specified GUIDs.
                 if (!values.containsKey(Passwords.GUID)) {
                     String guid = Utils.generateGuid();
                     values.put(Passwords.GUID, guid);
                 }
-                String nowString = new Long(now).toString();
+                String nowString = Long.toString(now);
                 DBUtils.replaceKey(values, null, Passwords.HOSTNAME, "");
                 DBUtils.replaceKey(values, null, Passwords.HTTP_REALM, "");
                 DBUtils.replaceKey(values, null, Passwords.FORM_SUBMIT_URL, "");
                 DBUtils.replaceKey(values, null, Passwords.USERNAME_FIELD, "");
                 DBUtils.replaceKey(values, null, Passwords.PASSWORD_FIELD, "");
                 DBUtils.replaceKey(values, null, Passwords.ENCRYPTED_USERNAME, "");
                 DBUtils.replaceKey(values, null, Passwords.ENCRYPTED_PASSWORD, "");
                 DBUtils.replaceKey(values, null, Passwords.ENC_TYPE, "0");
--- a/mobile/android/base/sync/config/ConfigurationMigrator.java
+++ b/mobile/android/base/sync/config/ConfigurationMigrator.java
@@ -234,17 +234,17 @@ public class ConfigurationMigrator {
     }
     if (clientName != null) {
       Logger.debug(LOG_TAG, "Migrated client name.");
       accountManager.setUserData(account, V1_PREF_CLIENT_NAME, clientName);
       count += 1;
     }
     if (numClients > -1) {
       Logger.debug(LOG_TAG, "Migrated clients count.");
-      accountManager.setUserData(account, V1_PREF_NUM_CLIENTS, new Long(numClients).toString());
+      accountManager.setUserData(account, V1_PREF_NUM_CLIENTS, Long.toString(numClients));
       count += 1;
     }
     return count;
   }
 
   /**
    * Extract version 0 per-Android account user data and write to version 1 per-Sync account shared prefs.
    *