Increment in steps linearly instead of doubling them, otherwise it will get to maximum limit of 4096 too soon. Also replace the loop with simple math. SVN revision: 46585