Skip to content

Commit

Permalink
Phoenix: Remove use of var keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
skynetcap committed Nov 27, 2023
1 parent c1a7df9 commit 0842c46
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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<Integer, Integer> next = freeListPointersList.get(freeListHead - 1);
indexToRemove = next.component1();
freeListHead = next.component2();

Expand All @@ -201,7 +202,7 @@ private static void readTraderBuffer(byte[] traderBuffer, PhoenixMarket market)
}
}

var traderList = market.getTraders();
List<Pair<PublicKey, PhoenixTraderState>> traderList = market.getTraders();
for (int i = 0; i < traderList.size(); i++) {
Pair<PublicKey, PhoenixTraderState> entry = traderList.get(i);
if (!freeNodes.contains(i)) {
Expand Down Expand Up @@ -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<Integer, Integer> next = freeListPointersList.get(freeListHead - 1);
indexToRemove = next.component1();
freeListHead = next.component2();

Expand All @@ -262,7 +263,7 @@ private static void readBidBuffer(byte[] bidBuffer, PhoenixMarket market) {
}
}

var bidOrdersList = market.getBidList();
List<Pair<FIFOOrderId, FIFORestingOrder>> bidOrdersList = market.getBidList();
for (int i = 0; i < bidOrdersList.size(); i++) {
Pair<FIFOOrderId, FIFORestingOrder> entry = bidOrdersList.get(i);
if (!freeNodes.contains(i)) {
Expand Down Expand Up @@ -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<Integer, Integer> next = freeListPointersList.get(freeListHead - 1);
indexToRemove = next.component1();
freeListHead = next.component2();

Expand All @@ -323,7 +324,7 @@ private static void readAskBuffer(byte[] bidBuffer, PhoenixMarket market) {
}
}

var askOrdersList = market.askList;
List<Pair<FIFOOrderId, FIFORestingOrder>> askOrdersList = market.getAskList();
for (int i = 0; i < askOrdersList.size(); i++) {
Pair<FIFOOrderId, FIFORestingOrder> entry = askOrdersList.get(i);
if (!freeNodes.contains(i)) {
Expand Down

0 comments on commit 0842c46

Please sign in to comment.