Tighten and simplify
This commit is contained in:
parent
2f3a249ab5
commit
a7f5589881
18
actor.ts
18
actor.ts
|
@ -92,10 +92,8 @@ export class Turn {
|
|||
return new Ref(this._ensureActor(what), t);
|
||||
}
|
||||
|
||||
spawn(bootProc: (t: Turn) => void, initialAssertions?: IdentitySet<Handle>): void {
|
||||
if ((initialAssertions !== void 0) && (initialAssertions.size > 0)) {
|
||||
this._ensureActor("spawn with initialAssertions");
|
||||
}
|
||||
spawn(bootProc: (t: Turn) => void, initialAssertions = new IdentitySet<Handle>()): void {
|
||||
if (initialAssertions.size > 0) this._ensureActor("spawn with initialAssertions");
|
||||
this.localActions.push(() => {
|
||||
const child = new Actor(this.actor === null
|
||||
? void 0
|
||||
|
@ -157,13 +155,11 @@ export class Turn {
|
|||
}
|
||||
}
|
||||
|
||||
function extractFromMap<K, V>(map: Map<K, V>, keys?: IdentitySet<K>): Map<K, V> {
|
||||
function extractFromMap<K, V>(map: Map<K, V>, keys: IdentitySet<K>): Map<K, V> {
|
||||
const result: Map<K, V> = new Map();
|
||||
if (keys !== void 0) {
|
||||
keys.forEach(key => {
|
||||
if (map.has(key)) result.set(key, map.get(key)!);
|
||||
map.delete(key);
|
||||
});
|
||||
}
|
||||
keys.forEach(key => {
|
||||
if (map.has(key)) result.set(key, map.get(key)!);
|
||||
map.delete(key);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue