Skip to content

Conversation

@mike-turintech
Copy link
Member

This pull request updates the PrimeFactors method to use java.util.ArrayList instead of java.util.Vector for storing prime factors. The change includes an update to the method's return type and the internal collection instantiation. Additionally, the JavaDoc comments have been revised to reflect the new collection type used. This refactor enhances performance by eliminating the overhead associated with Vector's default synchronization, making the method more efficient in single-threaded scenarios. It also aligns the code with modern Java practices by opting for ArrayList, which is generally lighter and faster. Note that the logic for calculating prime factors remains unchanged; only the collection type has been modified. Users of the method will need to adjust their code to accommodate the new return type.

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

Successfully merging this pull request may close these issues.

3 participants