Skip to content

Commit

Permalink
perf(fold): improve performance by using shorter names
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Medeiros committed Feb 26, 2016
1 parent 724f134 commit 8a25fe7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/operator/FoldMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {emptyObserver} from '../utils/emptyObserver';

export class Proxy<T, R> implements Observer<T> {
constructor(public out: Stream<R>,
public machine: FoldMachine<T, R>) {
public m: FoldMachine<T, R>) {
}

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) {
Expand All @@ -26,7 +26,7 @@ export class FoldMachine<T, R> implements Machine<R> {
public proxy: Observer<T> = 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<T>) {
this.acc = seed;
Expand Down

0 comments on commit 8a25fe7

Please sign in to comment.