3 ms·
Maybe if the thing that is generating the cond at the call location is inline-able, but not if it's doing an expensive operation. https://play.golang.org/p/Ts6
by kasey_junk 8y ago
Maybe if the thing that is generating the cond at the call location is inline-able, but not if it's doing an expensive operation.
https://play.golang.org/p/Ts6QqRrWwuQ https://play.golang.org/p/Ts6QqRrWwuQ
I couldn't get that to not trigger the lock.
[later] I could get it to remove it if you pass in a func instead.
- chronial 8y agoYour Cond() has a side-effect. It can never be optimized away.
- kasey_junk 8y agoCorrect. Which is one of the differences between this approach & macros. Though the lazy approach appears to work.