From aa53603135fa8699b1465dca40556c14ed332551 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Wed, 6 Nov 2013 06:59:00 -0600 Subject: [PATCH] winemac: Reduce duplicated code by consolidating exit paths from format_for_type(). --- dlls/winemac.drv/clipboard.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c index 5d765f4706b..f97faeaf3b4 100644 --- a/dlls/winemac.drv/clipboard.c +++ b/dlls/winemac.drv/clipboard.c @@ -361,10 +361,7 @@ static WINE_CLIPFORMAT* format_for_type(WINE_CLIPFORMAT *current, CFStringRef ty { format = LIST_ENTRY(ptr, WINE_CLIPFORMAT, entry); if (CFEqual(format->type, type)) - { - TRACE(" -> %p/%s\n", format, debugstr_format(format->format_id)); - return format; - } + goto done; } format = NULL; @@ -376,7 +373,7 @@ static WINE_CLIPFORMAT* format_for_type(WINE_CLIPFORMAT *current, CFStringRef ty { ERR("Shouldn't happen. Built-in type %s should have matched something in format list.\n", debugstr_cf(type)); - return NULL; + goto done; } else if (CFStringHasPrefix(type, registered_name_type_prefix)) { @@ -403,6 +400,7 @@ static WINE_CLIPFORMAT* format_for_type(WINE_CLIPFORMAT *current, CFStringRef ty HeapFree(GetProcessHeap(), 0, name); } +done: TRACE(" -> %p/%s\n", format, debugstr_format(format ? format->format_id : 0)); return format; } -- 2.11.4.GIT