From 0842c465c4f418759e80cb3b5858aa4db50bb75a Mon Sep 17 00:00:00 2001 From: skynetcap <100323448+skynetcap@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:29:32 -0800 Subject: [PATCH] Phoenix: Remove use of `var` keyword --- .../mmorrell/phoenix/model/PhoenixMarket.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/phoenix/src/main/java/com/mmorrell/phoenix/model/PhoenixMarket.java b/phoenix/src/main/java/com/mmorrell/phoenix/model/PhoenixMarket.java index 7e7806f..5d769ff 100644 --- a/phoenix/src/main/java/com/mmorrell/phoenix/model/PhoenixMarket.java +++ b/phoenix/src/main/java/com/mmorrell/phoenix/model/PhoenixMarket.java @@ -90,11 +90,12 @@ public static PhoenixMarket readPhoenixMarket(byte[] data) { 16 + 16 + (16 + FIFOOrderId.FIFO_ORDER_ID_SIZE + FIFORestingOrder.FIFO_RESTING_ORDER_SIZE) * phoenixMarket.getPhoenixMarketHeader().getBidsSize(); byte[] bidBuffer = Arrays.copyOfRange(data, 880, (int) bidsSize); - var asksSize = + long asksSize = 16 + 16 + (16 + FIFOOrderId.FIFO_ORDER_ID_SIZE + FIFORestingOrder.FIFO_RESTING_ORDER_SIZE) * phoenixMarket.getPhoenixMarketHeader().getAsksSize(); byte[] askBuffer = Arrays.copyOfRange(data, 880 + (int) bidsSize, 880 + (int) bidsSize + (int) asksSize); - var tradersSize = 16 + 16 + (16 + 32 + PhoenixTraderState.PHOENIX_TRADER_STATE_SIZE) * phoenixMarket.getPhoenixMarketHeader().getNumSeats(); + long tradersSize = + 16 + 16 + (16 + 32 + PhoenixTraderState.PHOENIX_TRADER_STATE_SIZE) * phoenixMarket.getPhoenixMarketHeader().getNumSeats(); byte[] traderBuffer = Arrays.copyOfRange(data, 880 + (int) bidsSize + (int) asksSize, 880 + (int) bidsSize + (int) asksSize + (int) tradersSize); @@ -189,7 +190,7 @@ private static void readTraderBuffer(byte[] traderBuffer, PhoenixMarket market) int counter = 0; while (freeListHead != 0) { - var next = freeListPointersList.get(freeListHead - 1); + Pair next = freeListPointersList.get(freeListHead - 1); indexToRemove = next.component1(); freeListHead = next.component2(); @@ -201,7 +202,7 @@ private static void readTraderBuffer(byte[] traderBuffer, PhoenixMarket market) } } - var traderList = market.getTraders(); + List> traderList = market.getTraders(); for (int i = 0; i < traderList.size(); i++) { Pair entry = traderList.get(i); if (!freeNodes.contains(i)) { @@ -250,7 +251,7 @@ private static void readBidBuffer(byte[] bidBuffer, PhoenixMarket market) { int counter = 0; while (freeListHead != 0) { - var next = freeListPointersList.get(freeListHead - 1); + Pair next = freeListPointersList.get(freeListHead - 1); indexToRemove = next.component1(); freeListHead = next.component2(); @@ -262,7 +263,7 @@ private static void readBidBuffer(byte[] bidBuffer, PhoenixMarket market) { } } - var bidOrdersList = market.getBidList(); + List> bidOrdersList = market.getBidList(); for (int i = 0; i < bidOrdersList.size(); i++) { Pair entry = bidOrdersList.get(i); if (!freeNodes.contains(i)) { @@ -311,7 +312,7 @@ private static void readAskBuffer(byte[] bidBuffer, PhoenixMarket market) { int counter = 0; while (freeListHead != 0) { - var next = freeListPointersList.get(freeListHead - 1); + Pair next = freeListPointersList.get(freeListHead - 1); indexToRemove = next.component1(); freeListHead = next.component2(); @@ -323,7 +324,7 @@ private static void readAskBuffer(byte[] bidBuffer, PhoenixMarket market) { } } - var askOrdersList = market.askList; + List> askOrdersList = market.getAskList(); for (int i = 0; i < askOrdersList.size(); i++) { Pair entry = askOrdersList.get(i); if (!freeNodes.contains(i)) {