78307fd


Jonah


On Thu, Oct 24, 2013 at 3:09 PM, Alex Zylman <notifications@github.com>wrote:

> In lib/transforms/join.coffee:
>
> > -        # Put r back at the head of right so we can read it again next
> > -        # _transform or in _flush
> > -        @right.unshift r
> > -        return next()
> > -      else if l[@key] is r[@key]
> > -        @push _.extend {}, l, r
> > -        return next()
> > -    @push l
> > -    next()
> > +    # Loop asynchronously so that the right stream has time to set its
> > +    # internal state to signal that it's ended.
> > +    async.whilst (=> l? and not ended @right), (cb_w) =>
> > +      r = @right.read()
> > +      switch
> > +        when not r?
> > +          setImmediate cb_w
>
> It looks like every branch has setImmediate - can we pull that out?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Clever/understream/pull/34/files#r7203264>
> .
>