Confirm token equality, safer loop
Using different variable to iterate to guarantee unchanged behaviour if anything doesn't work as intended.
This commit is contained in:
parent
979c74d0d0
commit
4a0841745a
|
@ -1055,10 +1055,17 @@ private:
|
||||||
|
|
||||||
// Account for possible function literals in this array which offset
|
// Account for possible function literals in this array which offset
|
||||||
// the previously set index (pos). Fixes issue #432.
|
// the previously set index (pos). Fixes issue #432.
|
||||||
while(astInformation.indentInfoSortedByEndLocation[pos].endLocation !=
|
size_t newPos = pos;
|
||||||
|
while(astInformation.indentInfoSortedByEndLocation[newPos].endLocation <
|
||||||
tokens[index].index)
|
tokens[index].index)
|
||||||
{
|
{
|
||||||
pos++;
|
newPos++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (astInformation.indentInfoSortedByEndLocation[newPos].endLocation ==
|
||||||
|
tokens[index].index)
|
||||||
|
{
|
||||||
|
pos = newPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto indentInfo = astInformation.indentInfoSortedByEndLocation[pos];
|
auto indentInfo = astInformation.indentInfoSortedByEndLocation[pos];
|
||||||
|
|
Loading…
Reference in New Issue