small performance fixes : unnecessary unboxing operations removed

Motivation :

Unboxing operations allocate unnecessary objects when it could be avoided.

Modifications:
Replaced Float.valueOf with Number.parseFloat where possible.

Result:

Less unnecessary objects allocations.
This commit is contained in:
Dmitriy Dumanskiy 2016-08-01 00:20:45 +03:00 committed by Norman Maurer
parent 5ed02fa585
commit 7a4a27574f

View File

@ -141,7 +141,7 @@ public class HttpContentCompressor extends HttpContentEncoder {
int equalsPos = encoding.indexOf('=');
if (equalsPos != -1) {
try {
q = Float.valueOf(encoding.substring(equalsPos + 1));
q = Float.parseFloat(encoding.substring(equalsPos + 1));
} catch (NumberFormatException e) {
// Ignore encoding
q = 0.0f;