HashMap的基础知识
if(!chatHistoryMap.containsKey(type)) {
chatHistoryMap.put(type,new ArrayList<>());
}
List<String> chatIds = chatHistoryMap.get(type);
等同于:
List<String> chatIds = chatHistoryMap.computeIfAbsent(type, k -> new ArrayList<>());

浙公网安备 33010602011771号