Likely it won't make a difference in speed at all, but technically you can keep the max around when reading the edges rather than calling max again.