From c6d121d93f57cd0a5e3622e72dec4033c25c8f3b Mon Sep 17 00:00:00 2001 From: mquinson Date: Mon, 7 Jan 2008 23:07:21 +0000 Subject: [PATCH] Simplification (plus remove a warning blocking the compilation) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5176 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/msg/msg_mailbox.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/msg/msg_mailbox.c b/src/msg/msg_mailbox.c index 18621380a0..a6556a2cef 100644 --- a/src/msg/msg_mailbox.c +++ b/src/msg/msg_mailbox.c @@ -169,28 +169,10 @@ MSG_mailbox_free(void* mailbox) msg_mailbox_t MSG_mailbox_get_by_alias(const char* alias) { - xbt_ex_t e; - int found = 1; - msg_mailbox_t mailbox; - TRY - { - mailbox = xbt_dict_get(msg_mailboxes,alias); - } - CATCH(e) - { - if (e.category == not_found_error) - { - found = 0; - xbt_ex_free(e); - } - else - { - RETHROW; - } - } - - if(!found) + msg_mailbox_t mailbox = xbt_dict_get_or_null(msg_mailboxes,alias); + + if(!mailbox) { mailbox = MSG_mailbox_new(alias); MSG_mailbox_set_hostname(mailbox,MSG_host_self()->name); -- 2.20.1