Another minor performance improvement.

This commit is contained in:
Olof Larsson 2015-01-08 10:00:13 +01:00
parent 8dac1eeece
commit b857df8763
2 changed files with 4 additions and 7 deletions

View File

@ -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())

View File

@ -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();