api: in getStats(), directly rewrote activePads as an expression
Instead of creating an empty Set and then mutate it.pull/3851/head
parent
82b919fc65
commit
4ef59bbda0
|
@ -851,13 +851,10 @@ exports.createDiffHTML = async function(padID, startRev, endRev) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.getStats = async function() {
|
exports.getStats = async function() {
|
||||||
const sessionKeys = Object.keys(padMessageHandler.sessioninfos);
|
const sessionInfos = padMessageHandler.sessioninfos;
|
||||||
|
|
||||||
const activePads = new Set();
|
const sessionKeys = Object.keys(sessionInfos);
|
||||||
|
const activePads = new Set(Object.entries(sessionInfos).map(k => k[1].padId));
|
||||||
sessionKeys
|
|
||||||
.map(k => padMessageHandler.sessioninfos[k])
|
|
||||||
.forEach(o => activePads.add(o.padId));
|
|
||||||
|
|
||||||
const { padIDs } = await padManager.listAllPads();
|
const { padIDs } = await padManager.listAllPads();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue