Skip to content

Inefficient Usages of Java Collections #135

@FastAtlas

Description

@FastAtlas

Hi,

We find that there are several inefficient usages of Java Collections:

  1. There is no iteration occurring upon a LinkedHashMap, thus the insertion order does not matter. We recommend replacing it with a HashMap.
  2. ArrayList is inserted before an iteration, while multiple memory reallocation might occur when the size of the list exceeds its capacity. We recommend replacing it with a LinkedList.

We discovered the above inefficient usages of containers by our tool Ditto. The patch is submitted in #134. Could you please check and accept it? We have tested the patch on our PC. The patched program works well.

Bests

Ditto

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions