From 4c0e2b448efb3dcd669c71043445e4d5d07a0f9d Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 22 Feb 2021 21:08:14 +0100 Subject: [PATCH] Simplify --- actor.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/actor.ts b/actor.ts index 6112224..dd2b260 100644 --- a/actor.ts +++ b/actor.ts @@ -30,7 +30,7 @@ export class Ref { } } -export type OutboundMap = Map, Assertion]>; +export type OutboundMap = Map>; export class Actor { readonly outbound: OutboundMap; @@ -47,7 +47,7 @@ export class Actor { terminateWith(t: Turn, reason: Exclude) { if (this.alive) { this.exitReason = reason; - this.outbound.forEach(([peer, _a], h) => t._retract(peer, h)); + this.outbound.forEach((peer, h) => t._retract(peer, h)); } } @@ -116,14 +116,14 @@ export class Turn { assert(location: Ref, assertion: Assertion): Handle { const h = nextHandle++; this.enqueue(location.actor, t => { - this._ensureActor("assert").outbound.set(h, [location, assertion]); + this._ensureActor("assert").outbound.set(h, location); location.target[assert]?.(t, assertion, h); }); return h; } retract(h: Handle): void { - this._retract(this._ensureActor("retract").outbound.get(h)![0], h); + this._retract(this._ensureActor("retract").outbound.get(h)!, h); } replace(location: Ref, h: Handle | undefined, assertion: Assertion): Handle {