You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is heavy because it is importing the entire math and because it's getting into the woods with cross conversions into float and back to int. Furthermore, math is being imported just for the sake of ceil.
Issue
The last line of the
Page
class reads:This is heavy because it is importing the entire
math
and because it's getting into the woods with cross conversions intofloat
and back toint
. Furthermore,math
is being imported just for the sake ofceil
.First fix
As a first approach, I'd have gone with:
but this is just a small optimisation on the exact same solution, thinking of those of us that deal with embedded devices and fight for space.
Second fix
I'd like to put it to you that there is a simpler, lighter way to accomplish this:
This fix is:
total
norpage_size
are allowed to be negative or zero;I hope this helps.
The text was updated successfully, but these errors were encountered: