junkdog / artemis-odb

A continuation of the popular Artemis ECS framework
BSD 2-Clause "Simplified" License
777 stars 112 forks source link

[Question] Needless component creation in EntityEdit#add(Component) #661

Open navneetankur opened 1 year ago

navneetankur commented 1 year ago

EntityEdit#add(Component) first creates a component using reflection and then replaces it with the component provided in argument. Why not just use the argument component directly.

It needlessly creates an extra component to be garbage collected as well as time taken to create that component using reflection. Seems like a simple fix. Am I missing something?