repositories
/
e-mobility-charging-stations-simulator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f90f59
)
Optimize a loop in the worker related code.
author
Jérôme Benoit
<jerome.benoit@sap.com>
Sat, 21 Aug 2021 20:02:28 +0000
(22:02 +0200)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Sat, 21 Aug 2021 20:02:28 +0000
(22:02 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerSet.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/worker/WorkerSet.ts
b/src/worker/WorkerSet.ts
index e224870d56b4b44757ba6185e6a1ff96407b15f7..e6421b14ab746fd816eadac1566fa44c4e705dbf 100644
(file)
--- a/
src/worker/WorkerSet.ts
+++ b/
src/worker/WorkerSet.ts
@@
-98,11
+98,12
@@
export default class WorkerSet<T> extends WorkerAbstract {
private getWorkerSetElementByWorker(worker: Worker): WorkerSetElement {
let workerSetElt: WorkerSetElement;
-
this.workerSet.forEach((workerSetElement) =>
{
+
for (const workerSetElement of this.workerSet)
{
if (workerSetElement.worker.threadId === worker.threadId) {
workerSetElt = workerSetElement;
+ break;
}
- }
);
+ }
return workerSetElt;
}
}