3 ms·
A lovely trick I found with libdispatch: when the async-nature is specified dynamically, invoke via a function pointer determined by the ternary operator:
by ridiculous_fish 12y ago
A lovely trick I found with libdispatch: when the async-nature is specified dynamically, invoke via a function pointer determined by the ternary operator:
(async ? dispatch_async : dispatch_sync)(queue, ^{
/* stuff */
});
The reader does a double-take, but it's so damn pretty!