Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small clean-up of the search related methods in TextLayerBuilder #10182

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Oct 25, 2018

This patch does four things:

  • Change the search related methods in TextLayerBuilder to be "private", since there're only called from within the class itself now.
  • Use const for local variables not intended to change in the search related methods in TextLayerBuilder.
  • Finally, removes most this.findController checks since they are redundant. Note how both this._convertMatches and this._renderMatches are only ever called, from this._updateMatches, when this.findController is actually defined. Hence there's really no need to repeat those checks all over the place, especially with all the relevant methods now being marked as "private".
  • Always initialize the this._pageMatchesLength property with an empty array, to simplify the code in TextLayerBuilder.

@Snuffleupagus Snuffleupagus force-pushed the TextLayerBuilder-rm-findController-checks branch from 1e6f9e2 to 46d3b01 Compare October 25, 2018 19:37
This patch does four things:
 - Change the search related methods in `TextLayerBuilder` to be "private", since there're only called from within the class itself now.
 - Use `const` for local variables not intended to change in the search related methods in `TextLayerBuilder`.
 - Finally, removes most `this.findController` checks since they are redundant. Note how both `this._convertMatches` and `this._renderMatches` are *only* ever called, from `this._updateMatches`, when `this.findController` is actually defined. Hence there's really no need to repeat those checks all over the place, especially with all the relevant methods now being marked as "private".
 - Always initialize the `this._pageMatchesLength` property with an empty array, to simplify the code in `TextLayerBuilder`.
@Snuffleupagus Snuffleupagus force-pushed the TextLayerBuilder-rm-findController-checks branch from 46d3b01 to d73a71f Compare October 25, 2018 19:38
@mozilla mozilla deleted a comment from pdfjsbot Oct 28, 2018
@mozilla mozilla deleted a comment from pdfjsbot Oct 28, 2018
@mozilla mozilla deleted a comment from pdfjsbot Oct 28, 2018
@mozilla mozilla deleted a comment from pdfjsbot Oct 28, 2018
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/c6f7a496856fa02/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/c6f7a496856fa02/output.txt

Total script time: 3.04 mins

Published

@timvandermeij timvandermeij merged commit 04ce2af into mozilla:master Oct 28, 2018
@timvandermeij
Copy link
Contributor

Nice clean-up!

@Snuffleupagus Snuffleupagus deleted the TextLayerBuilder-rm-findController-checks branch October 28, 2018 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants