Since IShapeF is an interface which is implemented by structs, those will get boxed that allocates and can trigger garbage collection.
providing an overload can prevent this. E.g. in the Shape class.
public static bool Intersects<TShapeA, TShapeB>(this TShape shapeA, TShape shapeB)
where TShape: struct, IShapeF
{
}
One could get a step further and obsolete the methods that take the interface and provide information why they should not be used.
If interested in this, I could look into and make pull requests for those changes.
Since
IShapeFis an interface which is implemented bystructs, those will get boxed that allocates and can trigger garbage collection.providing an overload can prevent this. E.g. in the Shape class.
One could get a step further and obsolete the methods that take the interface and provide information why they should not be used.
If interested in this, I could look into and make pull requests for those changes.