chathistoryplugin: combine nested if statements
This commit is contained in:
@@ -143,13 +143,11 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
|||||||
case MODPRIVATECHAT:
|
case MODPRIVATECHAT:
|
||||||
final String name = Text.removeTags(chatMessage.getName());
|
final String name = Text.removeTags(chatMessage.getName());
|
||||||
// Remove to ensure uniqueness & its place in history
|
// Remove to ensure uniqueness & its place in history
|
||||||
if (!friends.remove(name))
|
if (!friends.remove(name) &&
|
||||||
{
|
|
||||||
// If the friend didn't previously exist ensure deque capacity doesn't increase by adding them
|
// If the friend didn't previously exist ensure deque capacity doesn't increase by adding them
|
||||||
if (friends.size() >= FRIENDS_MAX_SIZE)
|
friends.size() >= FRIENDS_MAX_SIZE)
|
||||||
{
|
{
|
||||||
friends.remove();
|
friends.remove();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
friends.add(name);
|
friends.add(name);
|
||||||
// intentional fall-through
|
// intentional fall-through
|
||||||
|
|||||||
Reference in New Issue
Block a user