refactor: use set

This commit is contained in:
Barış Soner Uşaklı
2026-03-02 16:58:43 -05:00
parent e3119c76f3
commit d9344140a0

View File

@@ -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) => {