Merge pull request #10182 from Snuffleupagus/TextLayerBuilder-rm-findController-checks

Small clean-up of the search related methods in `TextLayerBuilder`
This commit is contained in:
Tim van der Meij 2018-10-28 13:45:01 +01:00 committed by GitHub
commit 04ce2afd4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 62 deletions

View file

@ -149,7 +149,7 @@ class PDFFindController {
this._highlightMatches = false;
this._pdfDocument = null;
this._pageMatches = [];
this._pageMatchesLength = null;
this._pageMatchesLength = [];
this._state = null;
this._selected = { // Currently selected match.
pageIdx: -1,
@ -304,9 +304,6 @@ class PDFFindController {
}
// Prepare arrays for storing the matches.
if (!this._pageMatchesLength) {
this._pageMatchesLength = [];
}
this._pageMatchesLength[pageIndex] = [];
this._pageMatches[pageIndex] = [];
@ -417,7 +414,7 @@ class PDFFindController {
this._offset.matchIdx = null;
this._resumePageIdx = null;
this._pageMatches.length = 0;
this._pageMatchesLength = null;
this._pageMatchesLength.length = 0;
this._matchesCountTotal = 0;
for (let i = 0; i < numPages; i++) {