Optimized Vector <= comparison

Former-commit-id: 8668b8ff78387262f0e21f038b6ca0240c513476
This commit is contained in:
Lynix
2012-12-02 20:39:49 +01:00
parent 0a88b6531c
commit 6a3087cc26
3 changed files with 27 additions and 3 deletions

View File

@@ -426,7 +426,10 @@ bool NzVector2<T>::operator<(const NzVector2& vec) const
template<typename T>
bool NzVector2<T>::operator<=(const NzVector2& vec) const
{
return operator<(vec) || operator==(vec);
if (x == vec.x)
return y <= vec.y;
else
return x < vec.x;
}
template<typename T>