If you're looking for available bytes, you should check for available,
then if it's timed out, and then wait and check again, not check,
wait, timeout. The final step effectively waits for 1 loop less, and
needlessly blocks. While this has very little impact at common baud
rates, and with the fixed loop counter in the current implementation, if
this loop counter is replaced with a baud rate appropriate timeout, you
can run into problems here due to overly eager "timeouts"
If you're looking for available bytes, you should check for available, then if it's timed out, and then wait and check again, not check, wait, timeout. The final step effectively waits for 1 loop less, and needlessly blocks. While this has very little impact at common baud rates, and with the fixed loop counter in the current implementation, if this loop counter is replaced with a baud rate appropriate timeout, you can run into problems here due to overly eager "timeouts"