Optimized IsNewLine method.