[telepathy-mission-control/master] _mcd_dispatch_operation_check_client_locks: turn observe_only into an early-return guard

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Oct 19 16:44:26 PDT 2009


---
 src/mcd-dispatch-operation.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 51d4d2f..06bc647 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -282,13 +282,16 @@ _mcd_dispatch_operation_check_client_locks (McdDispatchOperation *self)
         return;
     }
 
+    /* If we're only meant to be observing, do nothing */
+    if (self->priv->observe_only)
+    {
+        return;
+    }
+
     if (self->priv->invoked_approvers_if_needed &&
         _mcd_dispatch_operation_is_approved (self))
     {
-        if (!self->priv->observe_only)
-        {
-            _mcd_dispatch_operation_run_handlers (self);
-        }
+        _mcd_dispatch_operation_run_handlers (self);
     }
 }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list