3 ms·
I imagine it loops though the full width of the image every time it is called, which is every time the loop reaches the check. Since storing it will require wi
by __mark 15y ago
I imagine it loops though the full width of the image every time it is called, which is every time the loop reaches the check.
Since storing it will require width-1 less calls to im.getWidth() it is much more efficient no matter how you slice it.