[telepathy-mission-control/master] _mcd_dispatch_operation_approve: simplify
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Oct 27 14:36:59 PDT 2009
We don't need to call mcd_dispatch_operation_check_handle_with, because
it's harmless to append a redundant approval to the list even if someone
already approved further dispatching.
We can also simplify by not optimizing away a call to
_mcd_dispatch_operation_check_client_locks (calling that method too many
times is harmless).
---
src/mcd-dispatch-operation.c | 19 +++++--------------
1 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 979f5b3..37ccf21 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -1244,27 +1244,18 @@ _mcd_dispatch_operation_approve (McdDispatchOperation *self,
MCD_CLIENT_BASE_NAME_LEN);
}
+ g_queue_push_tail (self->priv->approvals,
+ approval_new (APPROVAL_TYPE_REQUESTED));
+
if (self->priv->ado_pending > 0 || self->priv->accepted_by_an_approver)
{
/* the existing channel is waiting for approval; but since the
* same channel has been requested, the approval operation must
* terminate */
- if (!mcd_dispatch_operation_check_handle_with (self, preferred_handler,
- NULL))
- {
- return;
- }
-
- g_queue_push_tail (self->priv->approvals,
- approval_new (APPROVAL_TYPE_REQUESTED));
_mcd_dispatch_operation_finish (self);
}
- else
- {
- g_queue_push_tail (self->priv->approvals,
- approval_new (APPROVAL_TYPE_REQUESTED));
- _mcd_dispatch_operation_check_client_locks (self);
- }
+
+ _mcd_dispatch_operation_check_client_locks (self);
}
static void
--
1.5.6.5
More information about the telepathy-commits
mailing list