mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 13:58:49 +00:00
543e41f3ac
MozPromise::All sets up 'Then' lambdas on all sub-promises, each one taking the resolve/reject object by value. Since this value will not be used again in the lambda, it is safe to Move it, and from there MozPromiseHolder::Resolve/Reject can also Move it again into the holder storage, potentially saving two copies per Resolve/Reject. Also, once all sub-promises have been resolved, the resolve-values can be Move'd into the joining promise's Resolve function.