From 3b514d2f7bd5bc3c922b6bd648c407ee40655107 Mon Sep 17 00:00:00 2001 From: Arbousier1 Date: Sat, 18 Jul 2026 11:25:17 +0800 Subject: [PATCH] perf(render): bypass synthetic accessors in applyQueue applyQueue accessed RegionUpdateQueue's private buckets via the bucketCount() and bucket(int) synthetic accessor methods that javac generates for private-inner-class field access. Read the buckets array field directly instead, eliminating two synthetic method calls per queue application. The field is reachable without accessors because RegionUpdateQueue is a private inner class of the same top-level class. Behavior is unchanged: the iteration order, early-return on deferred action, and QueueExecution result are all identical. --- .../mahjong/table/render/TableRegionDisplayCoordinator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/top/ellan/mahjong/table/render/TableRegionDisplayCoordinator.java b/src/main/java/top/ellan/mahjong/table/render/TableRegionDisplayCoordinator.java index 3bb6f37..e434ca0 100644 --- a/src/main/java/top/ellan/mahjong/table/render/TableRegionDisplayCoordinator.java +++ b/src/main/java/top/ellan/mahjong/table/render/TableRegionDisplayCoordinator.java @@ -476,8 +476,9 @@ public boolean hasStaleDisplayRegions() { private QueueExecution applyQueue(RegionUpdateQueue updates) { int processed = 0; - for (int bucketIndex = 0; bucketIndex < updates.bucketCount(); bucketIndex++) { - List bucket = updates.bucket(bucketIndex); + List[] buckets = updates.buckets; + for (int bucketIndex = 0; bucketIndex < buckets.length; bucketIndex++) { + List bucket = buckets[bucketIndex]; for (int updateIndex = 0, bucketSize = bucket.size(); updateIndex < bucketSize; updateIndex++) { if (!bucket.get(updateIndex).apply()) { return new QueueExecution(true, processed);