WTF::Function allocates memory on heap, which is totally redundant in this case. I've also tried using ScopedLambda, however its constructor doesn't allow conversion from non-lambda functions.
Created attachment 373026 [details] Patch
Comment on attachment 373026 [details] Patch Why not change ScopedLambda to allow a function pointer?
I thought about that, but it won't be Scoped*Lambda* anymore...
Created attachment 373041 [details] Patch
Yusuke adviced me to change it to template (to avoid indirect call in a loop)
Comment on attachment 373041 [details] Patch r=me
Comment on attachment 373041 [details] Patch Clearing flags on attachment: 373041 Committed r246906: <https://trac.webkit.org/changeset/246906>
All reviewed patches have been landed. Closing bug.
<rdar://problem/52285454>