jonasman / MulticastDelegate

An elegant multicast delegate written in swift
MIT License
149 stars 28 forks source link

Add `@noescape` attributes. #5

Closed JRG-Developer closed 8 years ago

JRG-Developer commented 8 years ago

Add @noescape attributes to decorate the closures.

This has two nice benefits: (1) Eliminates need for self inside the closure. (2) Small compiler optimizations

Even if a call is made inside the closure that isn't @noesacpe, this is okay: it only matters about the closure itself.

For more details, see here:

http://nshint.io/blog/2015/10/23/noescape-attribute/

JRG-Developer commented 8 years ago

Per my testing, this is also full backwards-compatible too.

That is, even if you did do the [weak self] dance, it's all still good.

💃

jonasman commented 8 years ago

will bump the version soon