Skip to content

Commit

Permalink
'#1889: Minor code enhancements.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Sep 22, 2023
1 parent 0d3b838 commit 5d954a3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ protected List<Chat> extractChatList() throws WAExtractorException {
}
}

Map<Long, Chat> idToChat = new HashMap<Long, Chat>();
String chatListQuery = hasProfilePictureItemTable ? SELECT_CHAT_LIST : SELECT_CHAT_LIST_NO_PPIC;

try (ResultSet rs = stmt.executeQuery(chatListQuery)) {
Expand All @@ -175,7 +174,6 @@ protected List<Chat> extractChatList() throws WAExtractorException {
activeChats.add(c.getId());
}
list.add(c);
idToChat.put(c.getId(), c);
}
}
} catch (SQLException ex) {
Expand All @@ -198,6 +196,10 @@ protected List<Chat> extractChatList() throws WAExtractorException {
}

// Extract messages of all non-group and group chats at once, not per chat
Map<Long, Chat> idToChat = new HashMap<Long, Chat>();
for (Chat c : list) {
idToChat.put(c.getId(), c);
}
extractMessages(conn, idToChat, firstTry, false);
extractMessages(conn, idToChat, firstTry, true);

Expand Down

0 comments on commit 5d954a3

Please sign in to comment.