Skip to content

Reduce allocations done by Resident hasRank methods#8037

Merged
LlmDl merged 2 commits intomasterfrom
fix/resident-has-rank-allocations
Jan 2, 2026
Merged

Reduce allocations done by Resident hasRank methods#8037
LlmDl merged 2 commits intomasterfrom
fix/resident-has-rank-allocations

Conversation

@Warriorrrr
Copy link
Copy Markdown
Member

Description:

Getting all residents in a town/nation with a specific rank goes through the Resident#hasRank method, which can allocate quite a bit total since it has to read all the ranks names from the config object.


  • I have tested this pull request for defects on a server.

By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.

@Warriorrrr Warriorrrr changed the title Fix/resident has rank allocations Reduce allocations done by Resident hasRank methods Dec 10, 2025
@LlmDl LlmDl added this to the 0.102.1.0 milestone Dec 13, 2025
@LlmDl LlmDl merged commit 65fa1d3 into master Jan 2, 2026
3 checks passed
@LlmDl LlmDl deleted the fix/resident-has-rank-allocations branch January 2, 2026 15:10
LlmDl added a commit that referenced this pull request Jan 2, 2026
Warrior with PR #8037.
  - Fix a logic error in the PlotGroup#setResident function, courtesy of
Remasuri with PR #8043.
  - Bit pack perms in TownyPermission objects, courtesy of Warrior with
PR #8048.
  - Remove world references stored inside WorldCoord, courtesy of
Warrior with PR #8050.
  - Fix message when attempting to overclaim your own town, courtesy of
Warrior with PR #8051.
LlmDl added a commit that referenced this pull request Jan 2, 2026
@LlmDl LlmDl restored the fix/resident-has-rank-allocations branch January 2, 2026 18:17
LlmDl added a commit that referenced this pull request Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants