From 8a25fe71f5cf41f217c64559ddba63bab88f6dc8 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Fri, 26 Feb 2016 23:00:29 +0200 Subject: [PATCH] perf(fold): improve performance by using shorter names --- src/operator/FoldMachine.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/operator/FoldMachine.ts b/src/operator/FoldMachine.ts index 7fa3857..e8fa517 100644 --- a/src/operator/FoldMachine.ts +++ b/src/operator/FoldMachine.ts @@ -5,12 +5,12 @@ import {emptyObserver} from '../utils/emptyObserver'; export class Proxy implements Observer { constructor(public out: Stream, - public machine: FoldMachine) { + public m: FoldMachine) { } next(t: T) { - const m = this.machine; - this.out.next(m.acc = m.accumulate(m.acc, t)); + const m = this.m; + this.out.next(m.acc = m.a(m.acc, t)); } error(err: any) { @@ -26,7 +26,7 @@ export class FoldMachine implements Machine { public proxy: Observer = emptyObserver; public acc: R; - constructor(public accumulate: (acc: R, t: T) => R, + constructor(public a: (acc: R, t: T) => R, seed: R, public ins: Stream) { this.acc = seed;