Commit 951663dc authored by Alain Laporte's avatar Alain Laporte Committed by Christoph Cullmann
Browse files

php_parser: reduce variable scope

parent 2896fa76
Pipeline #225907 passed with stage
in 7 minutes and 48 seconds
......@@ -115,21 +115,17 @@ void KatePluginSymbolViewerView::parsePhpSymbols(void)
// kdDebug(13000) << debugBuffer.arg(i, 4).arg("-comments", 10).arg(line);
// trying to find comments and to remove commented parts
int pos = line.indexOf(QLatin1Char('#'));
if (pos >= 0) {
if (const int pos = line.indexOf(QLatin1Char('#')); pos >= 0) {
line.truncate(pos);
}
pos = line.indexOf(QLatin1String("//"));
if (pos >= 0) {
if (const int pos = line.indexOf(QLatin1String("//")); pos >= 0) {
line.truncate(pos);
}
pos = line.indexOf(QLatin1String("/*"));
if (pos >= 0) {
if (const int pos = line.indexOf(QLatin1String("/*")); pos >= 0) {
line.truncate(pos);
inBlockComment = true;
}
pos = line.indexOf(QLatin1String("*/"));
if (pos >= 0) {
if (const int pos = line.indexOf(QLatin1String("*/")); pos >= 0) {
line = line.right(line.length() - pos - 2);
inBlockComment = false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment