mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 04:06:17 +02:00
refactor: use set
This commit is contained in:
@@ -318,16 +318,16 @@ Sockets.getUidsInRoom = async function (room) {
|
||||
return [];
|
||||
}
|
||||
const ioRoom = Sockets.server.in(room);
|
||||
const uids = [];
|
||||
const uids = new Set();
|
||||
if (ioRoom) {
|
||||
const sockets = await ioRoom.fetchSockets();
|
||||
for (const s of sockets) {
|
||||
if (s && s.data && s.data.uid > 0) {
|
||||
uids.push(s.data.uid);
|
||||
uids.add(s.data.uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return _.uniq(uids);
|
||||
return [...uids];
|
||||
};
|
||||
|
||||
Sockets.warnDeprecated = (socket, replacement) => {
|
||||
|
||||
Reference in New Issue
Block a user