Skip to content

Commit

Permalink
Try to clean up fields and local variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthegreat1 committed Dec 27, 2024
1 parent 9633ed9 commit 8f75506
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,11 @@ public void addToTooltip(@Nullable Slot focusedSlot, ItemStack stack, List<Text>
} else {
String outerKey = stack.getName().getString();
ObjectLongPair<String> innerMap, innerMapGreen;
if (bestSlotIndexSelling != -1) if (bestSlotIndexSelling == focusedSlot.getIndex()) isGreen = true;

calculateBestItems(getSlots());
BestItemsResult bestItemsResult = calculateBestItems(getSlots());
bestSlotIndexSelling = bestItemsResult.bestSlotIndexSelling;
bestSlotIndexAll = bestItemsResult.bestSlotIndexAll;
if (bestSlotIndexSelling != -1 && bestSlotIndexSelling == focusedSlot.getIndex()) isGreen = true;
innerMap = categoryOutput.get(outerKey);
innerMapGreen = categoryOutput.get(outerKey + "GREEN");

Expand Down Expand Up @@ -271,8 +273,8 @@ private Int2ObjectMap<ItemStack> getSlots() {
private BestItemsResult calculateBestItems(Int2ObjectMap<ItemStack> slots) {
long bestCoinsPerBitSelling = 0L;
long bestCoinsPerBitAll = 0L;
bestSlotIndexSelling = -1;
bestSlotIndexAll = -1;
int bestSlotIndexSelling = -1;
int bestSlotIndexAll = -1;
if (slots == null || slots.isEmpty()) return new BestItemsResult(bestSlotIndexSelling, bestSlotIndexAll, bestCoinsPerBitSelling, bestCoinsPerBitAll);

// process categories first
Expand Down

0 comments on commit 8f75506

Please sign in to comment.