From 01bf7d7c4e155fa012f8da876c25dd7376481e61 Mon Sep 17 00:00:00 2001 From: sdburns1998 Date: Sun, 7 Jul 2019 02:38:02 +0200 Subject: [PATCH] chathistoryplugin: combine nested if statements --- .../client/plugins/chathistory/ChatHistoryPlugin.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java index 86586dedf5..6b63e2c1d2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java @@ -143,13 +143,11 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener case MODPRIVATECHAT: final String name = Text.removeTags(chatMessage.getName()); // 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 (friends.size() >= FRIENDS_MAX_SIZE) - { - friends.remove(); - } + friends.size() >= FRIENDS_MAX_SIZE) + { + friends.remove(); } friends.add(name); // intentional fall-through