VS2010 Compilation errors and Equality/HashCode fixes#7
VS2010 Compilation errors and Equality/HashCode fixes#7CodesInChaos wants to merge 2 commits intomhutch:mainfrom
Conversation
|
The arg-less ctor will result in setting all fields to zero, so there will actually be 6 assignments. While a good optimizing compiler should be able to inline and eliminate it, I'm pretty sure neither .NET or Mono's JIT will do that. A better solution would be to make the fields internal and set them directly, like I did on the Vector classes. |
|
Though in practice it might just allocate everything from zeroed memory and thus be able to completely eliminate the blank ctor, AFAIK that isn't guaranteed. |
…nd added unit tests
|
You could also simply call the constructor that takes parameters. What I did was the smallest change to actually make it compile. |
|
I've added code fixing the quality problems in safe mode for Vector2, Vector3, Vector4 and Quaternion and added a unit tests to verify if equality behaves as expected. I assume the SIMD mode will fail these tests, but since I don't use mono I can't verify/fix it. |
When compiling Quaternion.cs with VS2010 I get an error because the out parameter is not definitely assigned. This is because you only assign properties. I've added
result = new Quaternion()where necessary.I've added code fixing the quality problems in safe mode for Vector2, Vector3, Vector4 and Quaternion and added a unit tests to verify if equality behaves as expected.