tweak trace context comparison
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 14 Aug 2004 20:54:59 +0000 (20:54 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 14 Aug 2004 20:54:59 +0000 (20:54 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@757 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/tracecontext.c

index 40b9147ae09e4ace942f5f058c54598d6c32986f..601208e8c356bbf95dfb18221f8dbe3a459bc362 100644 (file)
@@ -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;
 }
 
This page took 0.024989 seconds and 4 git commands to generate.