Closed Bug 1332825 Opened 3 years ago Closed 3 years ago
Promise::All could Move its given value into place
59 bytes, text/x-review-board-request
MozPromise::All sets up 'Then' lambdas on all promises, that take the resolve/reject object by value. Because of the way 'Then' works with lambdas, there's probably no better way to deal with this for now. But after that, once a lambda has its local value, it then passes it to the AllPromiseHolder by-value again. Instead, since this value will not be used again in the lambda, it would be safe to Move it, and from there the MozPromiseHolder::Resolve/Reject could also Move it again into the holder storage, potentially saving two copies per Resolve/Reject.
Comment on attachment 8829085 [details] Bug 1332825 - Use move semantics in MozPromise::All() and AllPromiseHolder - https://reviewboard.mozilla.org/r/106282/#review107356
Attachment #8829085 - Flags: review?(jwwang) → review+
Thanks for the reviews today!
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/8ac365ab3cfb Use move semantics in MozPromise::All() and AllPromiseHolder - r=jwwang
You need to log in before you can comment on or make changes to this bug.