From 0a60924c8f731f2a08484215388b920cd6ac89bd Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Mon, 4 Apr 2016 15:31:19 -0300 Subject: [PATCH] Reduces the amount of warnings Trimming the pull request #1098 --- .../transformations/remove_comments_char.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/actions/transformations/remove_comments_char.cc b/src/actions/transformations/remove_comments_char.cc index 6bca6cd0..7feaf87a 100644 --- a/src/actions/transformations/remove_comments_char.cc +++ b/src/actions/transformations/remove_comments_char.cc @@ -41,13 +41,20 @@ std::string RemoveCommentsChar::evaluate(std::string value, i = 0; while (i < value.size()) { - if (value.at(i) == '/' && (i+1 < value.size()) && value.at(i+1) == '*') { + if (value.at(i) == '/' + && (i+1 < value.size()) && value.at(i+1) == '*') { value.erase(i, 2); - } else if (value.at(i) == '*' && (i+1 < value.size()) && value.at(i+1) == '/') { + } else if (value.at(i) == '*' + && (i+1 < value.size()) && value.at(i+1) == '/') { value.erase(i, 2); - } else if (value.at(i) == '<' && (i+1 < value.size()) && value.at(i+1) == '!' && - (i+2 < value.size()) && value.at(i+2) == '-' && (i+3 < value.size()) && - value.at(i+3) == '-') { + } else if (value.at(i) == '<' + && (i+1 < value.size()) + && value.at(i+1) == '!' + && (i+2 < value.size()) + && value.at(i+2) == '-' + && (i+3 < value.size()) + && value.at(i+3) == '-') { + value.erase(i, 4); } else if (value.at(i) == '-' && (i+1 < value.size()) && value.at(i+1) == '-' && (i+2 < value.size()) && value.at(i+2) == '>') {