Skip to content

Commit

Permalink
Cache the landlord instead of parsing it twice in GeneralRegion#isLan…
Browse files Browse the repository at this point in the history
…dLord
  • Loading branch information
md5sha256 committed Nov 15, 2023
1 parent 23de684 commit d048665
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
Expand Down Expand Up @@ -517,7 +518,8 @@ public void removelandlord() {
* @return true if the player is the landlord, otherwise false
*/
public boolean isLandlord(UUID landlord) {
return landlord != null && getLandlord() != null && getLandlord().equals(landlord);
UUID ourLandlord = getLandlord();
return Objects.equals(landlord, ourLandlord);
}

/**
Expand Down

0 comments on commit d048665

Please sign in to comment.