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

perf: Avoid expensive Plot#getOwner calls in Plot#getOwners #4418

Merged

Conversation

Vrganj
Copy link
Contributor

@Vrganj Vrganj commented May 4, 2024

Overview

Description

Refactored Plot#getOwners and reduced the number of Plot#getOwner calls because
they go through a half dozen flag containers to check whether the plot is server-owned.

I'd like input on the first null check. The behavior is the same as the old implementation,
but it seems a little illogical. If there are 2 plots, one without an owner - getOwners would
return an empty set if called on the ownerless one, and 1 element on the other, creating
inconsistency.

Submitter Checklist

Preview Give feedback

@Vrganj Vrganj requested a review from a team as a code owner May 4, 2024 08:43
@SirYwell
Copy link
Member

SirYwell commented May 4, 2024

I assume the null check for the connected plots is rather an assert. The owner is only null if the plot is not claimed; and if it isn't claimed but merged with other plots at the same time, something is wrong already.

@Vrganj
Copy link
Contributor Author

Vrganj commented May 4, 2024

Ah, then I suppose one of null checks can be removed.

@NotMyFault NotMyFault added the Enhancement New feature or request label May 9, 2024
@NotMyFault NotMyFault merged commit 83fe761 into IntellectualSites:main May 9, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants