Commit 6ba182f3 authored by Tomaz Canabrava's avatar Tomaz Canabrava Committed by Tomaz Canabrava
Browse files

Declare and initialize the variable in one go

parent 3c49248a
......@@ -208,13 +208,9 @@ void Filter::getLineColumn(int position, int &startLine, int &startColumn)
Q_ASSERT(_buffer);
for (int i = 0; i < _linePositions->count(); i++) {
int nextLine = 0;
if (i == _linePositions->count() - 1) {
nextLine = _buffer->length() + 1;
} else {
nextLine = _linePositions->value(i + 1);
}
const int nextLine = i == _linePositions->count() - 1
? _buffer->length() + 1
: _linePositions->value(i + 1);
if (_linePositions->value(i) <= position && position < nextLine) {
startLine = i;
......
Markdown is supported
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