Skip to content

Commit 4806e87

Browse files
committed
write logic consistently
1 parent 800f22f commit 4806e87

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/simulation/BindingSimulator2D.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,14 +422,13 @@ export default class BindingSimulator implements IClientSimulatorImpl {
422422
(this.currentComplexMap.get(complexName) || 0) + amount
423423
);
424424

425-
const previousValue = this.currentComplexMap.get(a.id.toString()) || 0;
426-
const nextValue = previousValue + amount;
425+
const previousValueA = this.currentComplexMap.get(a.id.toString()) || 0;
426+
const nextValueA = previousValueA + amount;
427+
this.currentComplexMap.set(a.id.toString(), nextValueA);
427428

428-
this.currentComplexMap.set(a.id.toString(), nextValue);
429-
this.currentComplexMap.set(
430-
b.id.toString(),
431-
(this.currentComplexMap.get(b.id.toString()) || 0) + amount
432-
);
429+
const previousValueB = this.currentComplexMap.get(b.id.toString()) || 0;
430+
const nextValueB = previousValueB + amount;
431+
this.currentComplexMap.set(b.id.toString(), nextValueB);
433432
}
434433

435434
private resolveBindingReactions() {

0 commit comments

Comments
 (0)