Skip to content

Make all Renderers const #2629

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

Merged
merged 4 commits into from
Apr 28, 2021
Merged

Conversation

srawlins
Copy link
Member

All of the renderer classes which are referenced by the RendererFactories can be const; none have any fields. By making them const, we avoid re-constructing many instances, as a new one is created each time a getter on a RendererFactory is accessed.

Additionally, declare variables in DocumentationRendererHtml a little more simply; should help with null safety.

Additionally, in ParameterRenderer, reduce the amount of String concatenation and the number of StringBuffers used.

@google-cla google-cla bot added the cla: yes Google CLA check succeeded. label Apr 28, 2021
@coveralls
Copy link

coveralls commented Apr 28, 2021

Coverage Status

Coverage increased (+0.02%) to 57.572% when pulling 6d93cd9 on srawlins:const-renderers into d283722 on dart-lang:master.

@srawlins srawlins requested a review from jcollins-g April 28, 2021 09:16
@srawlins srawlins merged commit 4b616c1 into dart-lang:master Apr 28, 2021
@srawlins srawlins deleted the const-renderers branch April 28, 2021 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants