From 1b61742b53b18a1f6907708506f0433cf3e52e3b Mon Sep 17 00:00:00 2001 From: nodchip Date: Fri, 5 Mar 2010 12:04:09 +0000 Subject: [PATCH] Rewrote a object-comparison code using a standard function. It's a tiny refactoring. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5160 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/VertexLoader.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Source/Core/VideoCommon/Src/VertexLoader.h b/Source/Core/VideoCommon/Src/VertexLoader.h index b5eb0163ac..3a0f62b1de 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader.h +++ b/Source/Core/VideoCommon/Src/VertexLoader.h @@ -21,6 +21,7 @@ // Top vertex loaders // Metroid Prime: P I16-flt N I16-s16 T0 I16-u16 T1 i16-flt +#include #include #include "Common.h" @@ -44,17 +45,7 @@ public: vid[4] = g_VtxAttr[vtx_attr_group].g2.Hex & ~VAT_2_FRACBITS; } bool operator < (const VertexLoaderUID &other) const { - if (vid[0] < other.vid[0]) - return true; - else if (vid[0] > other.vid[0]) - return false; - for (int i = 1; i < 5; ++i) { - if (vid[i] < other.vid[i]) - return true; - else if (vid[i] > other.vid[i]) - return false; - } - return false; + return std::lexicographical_compare(vid, vid + sizeof(vid) / sizeof(vid[0]), other.vid, other.vid + sizeof(vid) / sizeof(vid[0])); } };