mirror of
https://github.com/correl/mage.git
synced 2024-11-28 11:09:54 +00:00
We're gonna use standart parameterised constructor, instead of addAll method.
This commit is contained in:
parent
192110cd68
commit
433b08238f
3 changed files with 3 additions and 6 deletions
|
@ -272,8 +272,7 @@ public class ChatManager {
|
|||
}
|
||||
|
||||
public ArrayList<ChatSession> getChatSessions() {
|
||||
ArrayList<ChatSession> chatSessionList = new ArrayList<>();
|
||||
chatSessionList.addAll(chatSessions.values());
|
||||
ArrayList<ChatSession> chatSessionList = new ArrayList<>(chatSessions.values());
|
||||
return chatSessionList;
|
||||
}
|
||||
|
||||
|
|
|
@ -388,8 +388,7 @@ public class TableManager {
|
|||
debugServerState();
|
||||
}
|
||||
logger.debug("TABLE HEALTH CHECK");
|
||||
ArrayList<Table> tableCopy = new ArrayList<>();
|
||||
tableCopy.addAll(tables.values());
|
||||
ArrayList<Table> tableCopy = new ArrayList<>(tables.values());
|
||||
for (Table table : tableCopy) {
|
||||
try {
|
||||
if (table.getState() != TableState.FINISHED) {
|
||||
|
|
|
@ -168,8 +168,7 @@ public class UserManager {
|
|||
private void checkExpired() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MINUTE, -3);
|
||||
List<User> usersToCheck = new ArrayList<>();
|
||||
usersToCheck.addAll(users.values());
|
||||
List<User> usersToCheck = new ArrayList<>(users.values());
|
||||
for (User user : usersToCheck) {
|
||||
if (!user.getUserState().equals(UserState.Expired) && user.isExpired(calendar.getTime())) {
|
||||
removeUser(user.getId(), DisconnectReason.SessionExpired);
|
||||
|
|
Loading…
Reference in a new issue