Remove unnecessary allocation+unboxing of objects.
Transforming String->int can be done with 0 allocations using Integer.parseInt. bug: 28078871 Change-Id: I8d9f322d7154728849dde61ef282046032858d60
This commit is contained in:
parent
15874cd028
commit
46f0dd69cd
2 changed files with 2 additions and 3 deletions
|
|
@ -1747,7 +1747,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
if(restoreDefaultNetworkDelayStr != null &&
|
||||
restoreDefaultNetworkDelayStr.length() != 0) {
|
||||
try {
|
||||
return Integer.valueOf(restoreDefaultNetworkDelayStr);
|
||||
return Integer.parseInt(restoreDefaultNetworkDelayStr);
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -548,8 +548,7 @@ public class NetworkDiagnostics {
|
|||
mMeasurement.description += " src{" + getSocketAddressString() + "}";
|
||||
|
||||
// This needs to be fixed length so it can be dropped into the pre-canned packet.
|
||||
final String sixRandomDigits =
|
||||
Integer.valueOf(mRandom.nextInt(900000) + 100000).toString();
|
||||
final String sixRandomDigits = String.valueOf(mRandom.nextInt(900000) + 100000);
|
||||
mMeasurement.description += " qtype{" + mQueryType + "}"
|
||||
+ " qname{" + sixRandomDigits + "-android-ds.metric.gstatic.com}";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue