Skip to content

Micro-optimization: avoid creating unnecessary objects #49

@kevingamez

Description

@kevingamez

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 “”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions