From f4979c841a80d47d0408139ab41319a849a37c0b Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 11 Jan 2024 02:11:24 +0000 Subject: [PATCH] Cleanup of some minor old cruft in the js code. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4757 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/core.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/core/core.js b/core/core.js index 203c14b2..61516e90 100644 --- a/core/core.js +++ b/core/core.js @@ -3,7 +3,6 @@ import * as auth from './auth.js'; import * as form from './form.js'; import * as http from './http.js'; -let gProcessIndex = 0; let gProcesses = {}; let gStatsTimer = false; @@ -125,8 +124,7 @@ function invoke(handlers, argv) { function broadcastEvent(eventName, argv) { let promises = []; - for (let i in gProcesses) { - let process = gProcesses[i]; + for (let process of Object.values(gProcesses)) { if (process.eventHandlers[eventName]) { promises.push(invoke(process.eventHandlers[eventName], argv)); } @@ -137,8 +135,7 @@ function broadcastEvent(eventName, argv) { function broadcast(message) { let sender = this; let promises = []; - for (let i in gProcesses) { - let process = gProcesses[i]; + for (let process of Object.values(gProcesses)) { if (process != sender && process.packageOwner == sender.packageOwner && process.packageName == sender.packageName) { @@ -151,9 +148,7 @@ function broadcast(message) { function getUser(caller, process) { return { - name: process.userName, key: process.key, - index: process.index, packageOwner: process.packageOwner, packageName: process.packageName, credentials: process.credentials, @@ -208,8 +203,6 @@ async function getProcessBlob(blobId, key, options) { print("Creating task for " + blobId + " " + key); process = {}; process.key = key; - process.index = gProcessIndex++; - process.userName = 'user' + process.index; process.credentials = options.credentials || {}; process.task = new Task(); process.eventHandlers = {};