Improve performance/usability in TmfTrace.seekEvent(ITmfTimestamp)
authorFrancois Chouinard <fchouinard@gmail.com>
Tue, 5 Jun 2012 13:41:35 +0000 (09:41 -0400)
committerFrancois Chouinard <fchouinard@gmail.com>
Tue, 5 Jun 2012 13:41:35 +0000 (09:41 -0400)
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java

index c308b92622ed870577d52d49eec468bd00be3668..ac9a909dc26dae37e2d19250ccb608d08597b8f0 100644 (file)
@@ -459,11 +459,6 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
                 event = getNext(context);
             }
         }
-//        System.out.println("seekEvent() before parseEvent() context=" + context);
-//        ITmfEvent event = fParser.parseEvent(context);
-//        System.out.println("seekEvent() after parseEvent() context=" + context + " TS=" + event.getTimestamp());
-//        event = fParser.parseEvent(context);
-//        System.out.println("seekEvent() after parseEvent() context=" + context + " TS=" + event.getTimestamp());
         return context;
     }
 
@@ -487,7 +482,7 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
         final ITmfContext nextEventContext = context.clone(); // Must use clone() to get the right subtype...
         ITmfEvent event = getNext(nextEventContext);
         while (event != null && event.getTimestamp().compareTo(timestamp, false) < 0) {
-            context = nextEventContext.clone();
+            getNext(context);
             event = getNext(nextEventContext);
         }
         if (event == null) {
This page took 0.051542 seconds and 5 git commands to generate.