Another minor performance improvement.
This commit is contained in:
parent
8dac1eeece
commit
b857df8763
@ -57,12 +57,8 @@ public class SenderColl<E extends SenderEntity<E>> extends Coll<E> implements Se
|
|||||||
|
|
||||||
if (ret == null)
|
if (ret == null)
|
||||||
{
|
{
|
||||||
ret = IdUtil.getId(oid);
|
// Always lower case.
|
||||||
}
|
return IdUtil.getId(oid);
|
||||||
|
|
||||||
if (ret == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isLowercasing())
|
if (this.isLowercasing())
|
||||||
|
@ -598,6 +598,7 @@ public class IdUtil implements Listener, Runnable
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This method always returns null or a lower case String.
|
||||||
public static String getId(Object senderObject)
|
public static String getId(Object senderObject)
|
||||||
{
|
{
|
||||||
// Null Return
|
// Null Return
|
||||||
@ -623,7 +624,7 @@ public class IdUtil implements Listener, Runnable
|
|||||||
if (senderObject instanceof Player) return ((Player)senderObject).getUniqueId().toString();
|
if (senderObject instanceof Player) return ((Player)senderObject).getUniqueId().toString();
|
||||||
|
|
||||||
// CommandSender
|
// CommandSender
|
||||||
if (senderObject instanceof CommandSender) return ((CommandSender)senderObject).getName();
|
if (senderObject instanceof CommandSender) return ((CommandSender)senderObject).getName().toLowerCase();
|
||||||
|
|
||||||
// UUID
|
// UUID
|
||||||
if (senderObject instanceof UUID) return ((UUID)senderObject).toString();
|
if (senderObject instanceof UUID) return ((UUID)senderObject).toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user