From a855f0590e59e0ec7c7270f56eb098e1a55b55cb Mon Sep 17 00:00:00 2001 From: compudj Date: Sat, 14 Aug 2004 20:54:59 +0000 Subject: [PATCH] tweak trace context comparison git-svn-id: http://ltt.polymtl.ca/svn@757 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/tracecontext.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 40b9147a..601208e8 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -33,16 +33,17 @@ gint compare_tracefile(gconstpointer a, gconstpointer b) const LttvTracefileContext *trace_a = (const LttvTracefileContext *)a; const LttvTracefileContext *trace_b = (const LttvTracefileContext *)b; - comparison = ltt_time_compare(trace_a->timestamp, trace_b->timestamp); - if(comparison == 0) { - if(trace_a->index < trace_b->index) comparison = -1; - else if(trace_a->index > trace_b->index) comparison = 1; - else if(trace_a->t_context->index < trace_b->t_context->index) - comparison = -1; - else if(trace_a->t_context->index > trace_b->t_context->index) - comparison = 1; + if(trace_a != trace_b) { + comparison = ltt_time_compare(trace_a->timestamp, trace_b->timestamp); + if(comparison == 0) { + if(trace_a->index < trace_b->index) comparison = -1; + else if(trace_a->index > trace_b->index) comparison = 1; + else if(trace_a->t_context->index < trace_b->t_context->index) + comparison = -1; + else if(trace_a->t_context->index > trace_b->t_context->index) + comparison = 1; + } } - return comparison; } -- 2.34.1