Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid useless deque clear on LevelTicks#cleanupAfterTick #149

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions 0125-perf-Avoid-useless-deque-clear-on-LevelTicks-cleanup.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MachineBreaker <saltspigotpp@gmail.com>
Date: Wed, 16 Oct 2024 03:39:24 -0400
Subject: [PATCH] perf: Avoid useless deque clear on
LevelTicks#cleanupAfterTick


diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
index 6f0dc05ec55214a2e68c37cd91b850b161a3641b..df1caabb9ca6af05950c0cb5ac51c76bd08878ff 100644
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
@@ -195,7 +195,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
}

private void cleanupAfterTick() {
- this.toRunThisTick.clear();
+ //this.toRunThisTick.clear(); // Leaf - This method runs after toRunThisTick is polled so this is always empty
this.containersToTick.clear();
this.alreadyRunThisTick.clear();
this.toRunThisTickSet.clear();