mirror of
https://github.com/igniterealtime/Spark.git
synced 2026-02-04 13:15:43 +00:00
SPARK-2378: ChatContainer: avoid allocation of ArrayList() on iteration
This commit is contained in:
committed by
Guus der Kinderen
parent
1b7eda406e
commit
541eaf336b
@ -537,7 +537,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
|
||||
return;
|
||||
}
|
||||
|
||||
for (ChatRoom chatRoom : new ArrayList<>(chatRoomList)) {
|
||||
for (ChatRoom chatRoom : chatRoomList) {
|
||||
closeTab(chatRoom);
|
||||
chatRoom.closeChatRoom();
|
||||
}
|
||||
@ -1475,7 +1475,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
|
||||
}
|
||||
|
||||
public void closeAllGroupChatRooms() {
|
||||
for (ChatRoom chatRoom : new ArrayList<>(chatRoomList)) {
|
||||
for (ChatRoom chatRoom : chatRoomList) {
|
||||
boolean isGroup = chatRoom.getChatType() == Message.Type.groupchat;
|
||||
if (isGroup) {
|
||||
closeTab(chatRoom);
|
||||
@ -1485,7 +1485,7 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
|
||||
}
|
||||
|
||||
public boolean hasGroupChatRooms() {
|
||||
for (ChatRoom chatRoom : new ArrayList<>(chatRoomList)) {
|
||||
for (ChatRoom chatRoom : chatRoomList) {
|
||||
boolean isGroup = chatRoom.getChatType() == Message.Type.groupchat;
|
||||
if (isGroup) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user