From 129e31373eaef9cbd74451bfeb4ad62b64d17250 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 6 Aug 2010 11:57:03 -0500
Subject: [PATCH] Better < operator for LLVolumeFace::VertexData

---
 indra/llmath/llvolume.cpp | 40 ++++++++++++++++++++++++++++++++-------
 1 file changed, 33 insertions(+), 7 deletions(-)

diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 0976487cbde..bba0a6d089d 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2055,22 +2055,48 @@ void LLVolumeFace::VertexData::setNormal(const LLVector4a& norm)
 
 bool LLVolumeFace::VertexData::operator<(const LLVolumeFace::VertexData& rhs)const
 {
-	if (mData[POSITION].notEqual3(rhs.getPosition()))
+	const F32* lp = this->getPosition().getF32();
+	const F32* rp = rhs.getPosition().getF32();
+
+	if (lp[0] != rp[0])
+	{
+		return lp[0] < rp[0];
+	}
+
+	if (rp[1] != lp[1])
+	{
+		return lp[1] < rp[1];
+	}
+
+	if (rp[2] != lp[2])
+	{
+		return lp[2] < rp[2];
+	}
+
+	lp = getNormal().getF32();
+	rp = rhs.getNormal().getF32();
+
+	if (lp[0] != rp[0])
+	{
+		return lp[0] < rp[0];
+	}
+
+	if (rp[1] != lp[1])
 	{
-		return mData[POSITION].less3(rhs.getPosition());
+		return lp[1] < rp[1];
 	}
 
-	if (mData[NORMAL].notEqual3(rhs.getNormal()))
+	if (rp[2] != lp[2])
 	{
-		return mData[NORMAL].less3(rhs.getNormal());
+		return lp[2] < rp[2];
 	}
 
-	if (mTexCoord != rhs.mTexCoord)
+	if (mTexCoord.mV[0] != rhs.mTexCoord.mV[0])
 	{
-		return mTexCoord < rhs.mTexCoord;
+		return mTexCoord.mV[0] < rhs.mTexCoord.mV[0];
 	}
 
-	return false;
+	return mTexCoord.mV[1] < rhs.mTexCoord.mV[1];
 }
 
 bool LLVolumeFace::VertexData::operator==(const LLVolumeFace::VertexData& rhs)const
-- 
GitLab