From edb7b86837f553f32929eddccb3ade6a4060d43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Sun, 8 Oct 2023 08:45:05 +0200 Subject: [PATCH] avoid some redundant checks in `TokenList::readfile()` (#324) --- simplecpp.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index 80458339..881b7c7f 100755 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -627,8 +627,6 @@ void simplecpp::TokenList::readfile(Stream &stream, const std::string &filename, unsigned char ch = stream.readChar(); if (!stream.good()) break; - if (ch < ' ' && ch != '\t' && ch != '\n' && ch != '\r') - ch = ' '; if (ch >= 0x80) { if (outputList) { @@ -694,7 +692,7 @@ void simplecpp::TokenList::readfile(Stream &stream, const std::string &filename, continue; } - if (std::isspace(ch)) { + if (ch <= ' ') { location.col++; continue; }