The main reason for math.Max is to ensure that some of the special cases of the IEEE floating point are handled correctly (positive and negative infinity, NaN and signed zeros).
These problems are not suitable for prime integers, so you can just use the obvious implementation. Something like:
if args.Viewnum+1 > vs.curView.Viewnum { vs.curView.Viewnum = args.Viewnum+1 }
James hestridge
source share