From 602cfa69104a6e8963e58d53e96a33f43e99e720 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Fri, 14 Jan 2011 10:16:26 -0500 Subject: [PATCH] Handle all ops consistently for StopSegments. If there is a reason why not all operators were implemented, I haven't seen one. Blame the Java experience within me. --- src/TimingData.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/TimingData.h b/src/TimingData.h index 942e4f821d..b4348475d1 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -54,10 +54,24 @@ struct StopSegment return true; } bool operator!=( const StopSegment &other ) const { return !operator==(other); } + // Delays need to come before stops to not render them pointless. bool operator<( const StopSegment &other ) const { - return ( m_iStartRow < other.m_iStartRow ) || - ( m_iStartRow == other.m_iStartRow && m_bDelay ); + return ( m_iStartRow < other.m_iStartRow ) || + ( m_iStartRow == other.m_iStartRow && m_bDelay && !other.m_bDelay ); + } + bool operator<=( const StopSegment &other ) const + { + return ( operator<(other) || operator==(other) ); + } + bool operator>( const StopSegment &other ) const + { + return ( m_iStartRow > other.m_iStartRow ) || + ( m_iStartRow == other.m_iStartRow && !m_bDelay && other.m_bDelay ); + } + bool operator>=( const StopSegment &other ) const + { + return ( operator>(other) || operator==(other) ); } };