Skip to content

Commit bd15495

Browse files
authored
enabled and fixed readability-simplify-boolean-expr clang-tidy warnings (#568)
1 parent 8e85885 commit bd15495

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ Checks: >
4242
-readability-isolate-declaration,
4343
-readability-magic-numbers,
4444
-readability-redundant-inline-specifier,
45-
-readability-simplify-boolean-expr,
4645
-readability-use-concise-preprocessor-directives,
4746
-readability-uppercase-literal-suffix,
4847
-performance-avoid-endl,

simplecpp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ void simplecpp::TokenList::readfile(Stream &stream, const std::string &filename,
882882
return;
883883
}
884884
const std::string endOfRawString(')' + delim + currentToken);
885-
while (stream.good() && !(endsWith(currentToken, endOfRawString) && currentToken.size() > 1))
885+
while (stream.good() && (!endsWith(currentToken, endOfRawString) || currentToken.size() <= 1))
886886
currentToken += stream.readChar();
887887
if (!endsWith(currentToken, endOfRawString)) {
888888
if (outputList) {
@@ -2052,7 +2052,7 @@ namespace simplecpp {
20522052
}
20532053

20542054
const Token *recursiveExpandToken(TokenList &output, TokenList &temp, const Location &loc, const Token *tok, const MacroMap &macros, const std::set<TokenString> &expandedmacros, const std::vector<const Token*> &parametertokens) const {
2055-
if (!(temp.cback() && temp.cback()->name && tok->next && tok->next->op == '(')) {
2055+
if (!temp.cback() || !temp.cback()->name || !tok->next || tok->next->op != '(') {
20562056
output.takeTokens(temp);
20572057
return tok->next;
20582058
}

0 commit comments

Comments
 (0)