GlmSharp
GlmSharp copied to clipboard
Unnecessary Object Creation
All optimizations of the following form:
public static vec4 Sub(vec4 lhs, vec4 rhs) => new vec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w);
to
public static vec4 Sub(vec4 lhs, vec4 rhs) {
lhs.x -= rhs.x;
lhs.y -= rhs.y;
lhs.z -= rhs.z;
lhs.w -= rhs.w;
return lhs;
}
To optimize for stack usage and less object creation.