mozilla/pdf.js — pull request #4976 by CodingFabian (2014-06-19 10:49:08+00:00)
Title: Restructured EvaluatorPreprocessor_read to be more natural.

As pointed out previously, the read method is invoked frequently (thousands to millions). In that loop always checking for EOF and than for not Command.
These are two checks for figuring out the most common case.
By changing it to a check for a command, the EOF check is implicitly done.
It also saves the continue logic as the valid command case sits safely inside an if block.