4 ms·
> It could also be avoided by splitting this into two separate functions, one for `top` and one for `left`, so the numbers don't have to be bundled up into an o
by danhau 4y ago
> It could also be avoided by splitting this into two separate functions, one for `top` and one for `left`, so the numbers don't have to be bundled up into an object to be returned.
This is probably a bad idea for performance too, as you'll potentially be doing lots of calculations twice.
- brundolf 4y agoIn some situations, though in this one I think they're actually totally independent But ofc in a real scenario where this matters you'd only want to optimize based on what a profiler says