summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hurst <jhurst@cinecert.com>2019-12-30 13:54:37 -0800
committerGitHub <noreply@github.com>2019-12-30 13:54:37 -0800
commitd37464b6fde37217372c5eea417e581f8b1d9b4e (patch)
treef923434f46a5c6585686d87410ad7c6a4809810f /src
parentedd06bc61a92f8a54a3cf6e999143cc34aad7f20 (diff)
parent75ca93c530e1f2531c66f7027213ec7514918508 (diff)
Merge pull request #13 from msheby/identifier-greater-than
added greater-than operator to Kumu::Identifier
Diffstat (limited to 'src')
-rwxr-xr-xsrc/KM_util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/KM_util.h b/src/KM_util.h
index e8004c1..f3f60f1 100755
--- a/src/KM_util.h
+++ b/src/KM_util.h
@@ -303,6 +303,18 @@ namespace Kumu
return false;
}
+ inline bool operator>(const Identifier& rhs) const {
+ ui32_t test_size = xmin(rhs.Size(), SIZE);
+
+ for ( ui32_t i = 0; i < test_size; i++ )
+ {
+ if ( m_Value[i] != rhs.m_Value[i] )
+ return m_Value[i] > rhs.m_Value[i];
+ }
+
+ return false;
+ }
+
inline bool operator==(const Identifier& rhs) const {
if ( rhs.Size() != SIZE ) return false;
return ( memcmp(m_Value, rhs.m_Value, SIZE) == 0 );