[sysprof] capture-cursor: skip when no read delegate was found



commit 4b95b38c0a2f984fce24af2e6fa717549df9c9d5
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 12 01:35:13 2016 -0700

    capture-cursor: skip when no read delegate was found
    
    If we were skipping due to no matching read delegate, then
    we can just ignore any checks on that frame and move to the
    next.

 lib/sp-capture-cursor.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/lib/sp-capture-cursor.c b/lib/sp-capture-cursor.c
index 2a58af5..3b98237 100644
--- a/lib/sp-capture-cursor.c
+++ b/lib/sp-capture-cursor.c
@@ -80,7 +80,7 @@ sp_capture_cursor_foreach (SpCaptureCursor         *self,
     {
       const SpCaptureFrame *frame;
       SpCaptureFrameType type = 0;
-      ReadDelegate delegate;
+      ReadDelegate delegate = NULL;
 
       if (!sp_capture_reader_peek_type (self->reader, &type))
         return;
@@ -130,7 +130,10 @@ sp_capture_cursor_foreach (SpCaptureCursor         *self,
           break;
         }
 
-      if (delegate != NULL && NULL == (frame = delegate (self->reader)))
+      if (delegate == NULL)
+        continue;
+
+      if (NULL == (frame = delegate (self->reader)))
         return;
 
       if (self->conditions->len == 0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]