From 6fdba42c026dcefd5585d7cb7eaf56ae5e101e10 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Mon, 10 May 2021 11:17:45 -0300 Subject: [PATCH] Cosmetics: Having cppcheck pleased (...) remove_comments.cc,62,style,knownConditionTrueFalse,Condition 'incomment==0' is always true (...) remove_comments.cc,66,style,knownConditionTrueFalse,Condition 'incomment==0' is always true (...) remove_comments.cc,69,style,knownConditionTrueFalse,Condition 'incomment==0' is always true --- src/actions/transformations/remove_comments.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/actions/transformations/remove_comments.cc b/src/actions/transformations/remove_comments.cc index 94441d5d..043dd950 100644 --- a/src/actions/transformations/remove_comments.cc +++ b/src/actions/transformations/remove_comments.cc @@ -59,14 +59,14 @@ std::string RemoveComments::evaluate(const std::string &value, } else if ((input[i] == '<') && (i + 1 < input_len) && (input[i + 1] == '!') && (i + 2 < input_len) && (input[i+2] == '-') && (i + 3 < input_len) - && (input[i + 3] == '-') && (incomment == 0)) { + && (input[i + 3] == '-')) { incomment = 1; i += 4; } else if ((input[i] == '-') && (i + 1 < input_len) - && (input[i + 1] == '-') && (incomment == 0)) { + && (input[i + 1] == '-')) { input[i] = ' '; break; - } else if (input[i] == '#' && (incomment == 0)) { + } else if (input[i] == '#') { input[i] = ' '; break; } else {