Skip to content

Convert internal package to use only static functions instead of instances #239

@severn-everett

Description

@severn-everett

The pattern of "create a new instance in order to execute function X exactly once" involves a lot of churn with object creation and destruction, even if escape analysis will optimize the object allocation to the stack instead of the heap. It would be better to convert classes like Comparator and Modifier to only use static functions that accept the Semver instance that they're working with as the first argument.

Metadata

Metadata

Labels

refactorSmall task connected with refactor

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions