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

Micro-optimization: avoid creating unnecessary objects #49

Open
kevingamez opened this issue Nov 26, 2023 · 0 comments
Open

Micro-optimization: avoid creating unnecessary objects #49

kevingamez opened this issue Nov 26, 2023 · 0 comments

Comments

@kevingamez
Copy link

In _requestBalances function in appstate_container.dart file, in requestUpdate function in appstate_container.dart file, keys in requestUpdate function in appstate_container.dart file and in queueContainsRequestWithHash function in account_service.dart file unnecessary objects are created.
image
There are objects that are created within the routes where a new element is instantiated each time an iteration is made in the code. The correction is simple, you have to create the objects outside the loop. For example, in the image the String combinedBalance could be initialize before the loops. It can be initialize with an empty value, as “”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant