The real reason for this CL is to claim commit #1000 :)

Tiny performance enhancement: Reordered type orders to move up String and Integer which are likely to be most common fields.
This commit is contained in:
Inderjeet Singh 2011-10-20 21:42:45 +00:00
parent 905b7ebccc
commit 339d3dd4d0

View File

@ -228,10 +228,11 @@ public final class Gson {
MiniGson.Builder builder = new MiniGson.Builder()
.withoutDefaultFactories()
.factory(TypeAdapters.STRING_FACTORY)
.factory(TypeAdapters.INTEGER_FACTORY)
.factory(TypeAdapters.BOOLEAN_FACTORY)
.factory(TypeAdapters.BYTE_FACTORY)
.factory(TypeAdapters.SHORT_FACTORY)
.factory(TypeAdapters.INTEGER_FACTORY)
.factory(TypeAdapters.newFactory(long.class, Long.class,
longAdapter(longSerializationPolicy)))
.factory(TypeAdapters.newFactory(double.class, Double.class,
@ -242,7 +243,6 @@ public final class Gson {
serializationExclusionStrategy, deserializationExclusionStrategy))
.factory(TypeAdapters.NUMBER_FACTORY)
.factory(TypeAdapters.CHARACTER_FACTORY)
.factory(TypeAdapters.STRING_FACTORY)
.factory(TypeAdapters.STRING_BUILDER_FACTORY)
.factory(TypeAdapters.STRING_BUFFER_FACTORY)
.typeAdapter(BigDecimal.class, new BigDecimalTypeAdapter())