Branch: Tag:

2017-11-27

2017-11-27 17:14:56 by Martin Nilsson <nilsson@fastmail.com>

Simplified fold_one() slightly. Interpretor lock ensures promise is either set or not.

478:       private void fold_one(mixed val) {    mixed err = catch (accumulator = fold_fun(val, accumulator, @extra)); -  if (err) { -  Promise p = promise; // Cache it, to cover a failure race -  if (p) p->failure(err); +  if (err && promise) +  promise->failure(err);    } -  } +        private void fold(function(mixed:void) failsucc) {    failsucc(fold_fun ? accumulator : results);