Simplify ifs since PP_WHITESPACE and WHITESPACE are the same

Change-Id: Ib18c60270d9275840db051f1eec86227cc8f6c1c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Albert Astals Cid 2018-01-10 14:43:49 +01:00
parent d1f2208eec
commit 537af27302

View File

@ -1131,14 +1131,14 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
Token lastToken = HASH; // skip shitespace at the beginning
for (int i = start; i < index - 1; ++i) {
Token token = symbols.at(i).token;
if (token == PP_WHITESPACE || token == WHITESPACE) {
if (token == WHITESPACE) {
if (lastToken == PP_HASH || lastToken == HASH ||
lastToken == PP_HASHHASH ||
lastToken == PP_WHITESPACE || lastToken == WHITESPACE)
lastToken == WHITESPACE)
continue;
} else if (token == PP_HASHHASH) {
if (!macro.symbols.isEmpty() &&
(lastToken == PP_WHITESPACE || lastToken == WHITESPACE))
lastToken == WHITESPACE)
macro.symbols.pop_back();
}
macro.symbols.append(symbols.at(i));