зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1732464 - Reverse the order of calls to FindLineContaining in IsLocalAccAtLineStart, so that we can pass prevLineNum as a starting index to accelerate the second call. r=Jamie
Depends on D126587 Differential Revision: https://phabricator.services.mozilla.com/D126588
This commit is contained in:
Родитель
ea7fdbb90f
Коммит
98c510163c
|
@ -155,14 +155,14 @@ static bool IsLocalAccAtLineStart(LocalAccessible* aAcc) {
|
|||
// same line, so we're at the start.
|
||||
return true;
|
||||
}
|
||||
nsAutoLineIterator it = thisBlock->GetLineIterator();
|
||||
nsAutoLineIterator it = prevBlock->GetLineIterator();
|
||||
MOZ_ASSERT(it, "GetLineIterator impl in line-container blocks is infallible");
|
||||
int32_t thisLineNum = it->FindLineContaining(thisLineFrame);
|
||||
if (thisLineNum < 0) {
|
||||
int32_t prevLineNum = it->FindLineContaining(prevLineFrame);
|
||||
if (prevLineNum < 0) {
|
||||
// Error; play it safe.
|
||||
return true;
|
||||
}
|
||||
int32_t prevLineNum = it->FindLineContaining(prevLineFrame);
|
||||
int32_t thisLineNum = it->FindLineContaining(thisLineFrame, prevLineNum);
|
||||
// if the blocks and line numbers are different, that means there's nothing
|
||||
// before us on the same line, so we're at the start.
|
||||
return thisLineNum != prevLineNum;
|
||||
|
|
Загрузка…
Ссылка в новой задаче