Update HopReadExtensions.cs

Optimization in while loop