u3d-community / U3D

Open-source, cross-platform 2D and 3D game engine built in C++
https://u3d.io
MIT License
191 stars 30 forks source link

Ambiguous meaning for CustomVariantValue::Compare #38

Open SirNate0 opened 1 year ago

SirNate0 commented 1 year ago

The meaning of CustomVariantValue::Compare is ambiguous. What does returning true indicate? From the Variant::operator == code (below) we can infer that true means equal, but from the name and documentation within CustomVariantValue it is not obvious whether true means "Equal" or "Less", etc.

https://github.com/u3d-community/U3D/blob/4903fa5b3a042e9d2cb0037041a6fb9cc78aa87c/Source/Urho3D/Core/Variant.cpp#L150-L155


At the very least, the documentation should be improved. Alternatively, the function name could be changed to Equals, which would itself clear up the ambiguity.