From cb0f2cae1367609fd86f076b4d37ae49424b74a7 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Sun, 30 May 2021 17:01:27 +0200 Subject: [PATCH] feat: optimized IntVector2Deserializer --- .../gamelibrary/json/ingame/IntVector2Deserializer.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/IntVector2Deserializer.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/IntVector2Deserializer.java index a01af72..cf35971 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/IntVector2Deserializer.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/IntVector2Deserializer.java @@ -12,13 +12,9 @@ import uulm.teamname.marvelous.gamelibrary.IntVector2; import java.io.IOException; public class IntVector2Deserializer extends JsonDeserializer { - - // static so that no reinitializations are needed - private static final ObjectMapper mapper = new ObjectMapper(); - @Override public IntVector2 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - var values = mapper.readValue(p, Integer[].class); + var values = p.readValueAs(Integer[].class); IntVector2 result = new IntVector2(values[0], values[1]); return result; }