Small performance improvement for PlayerDomain#contains() (#1765)

* Improve performance by putting UUID checks first.

* Added wizjany's suggestion

Co-authored-by: wizjany <wizjany@gmail.com>
This commit is contained in:
TheBusyBiscuit 2021-05-15 21:01:15 +02:00 committed by GitHub
parent 09ce3b6373
commit 7dcec2b3b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,7 +149,7 @@ public void removePlayer(LocalPlayer player) {
@Override
public boolean contains(LocalPlayer player) {
checkNotNull(player);
return contains(player.getName().trim().toLowerCase()) || contains(player.getUniqueId());
return contains(player.getUniqueId()) || (!names.isEmpty() && contains(player.getName()));
}
/**