vapor / async-kit

Sugary extensions for the SwiftNIO library
MIT License
71 stars 25 forks source link

Wrap the argument to `Future.transform` in an autoclosure #31

Closed MrMage closed 5 years ago

MrMage commented 5 years ago

This avoids creating the argument if it won't be needed at all, e.g. because a previous future fails.

calebkleveter commented 5 years ago

Should this also be added to the .transform method that takes in an EventLoopFuture?

MrMage commented 5 years ago

I don't think so; nearly all EventLoopFutures are created from a block that is only executed when the future succeeds, anyway.

penny-coin commented 5 years ago

Hey @MrMage, you just merged a pull request, have a coin!

You now have 11 coins.