bleroy / Nwazet.Commerce

Idiomatic commerce module for Orchard CMS.
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

Equality made to same value #155

Open MatteoPiovanelli-Laser opened 3 years ago

MatteoPiovanelli-Laser commented 3 years ago

https://github.com/bleroy/Nwazet.Commerce/blob/3f0e9a0b847437d22aa60662a0f8894456717e19/Nwazet.Commerce.Tests/TimePeriodTests.cs#L185

A bunch of those Assertions raise warning when building the project, because they are made between the same variable. Is there a reason why they need to be like that or can they be safely removed?

bleroy commented 3 years ago

Does the compiler optimize them away? It should not: those tests are testing the overloaded == operator and look legit. Seems like the right thing to do is to suppress the warnings.

MatteoPiovanelli-Laser commented 3 years ago

Ok. Makes sense. I don't think they are being optimized away, but I haven't checked in a long time. We were looking to clean up some of the warnings from our solution and those came up, so I thought I'd ask. Thanks for clearing them up.