From e848623b798a03f757e16c34b5e3610f37ae633d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Oct 2023 07:22:54 +0000 Subject: Minor simplification --- generic/tkMenu.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 6de8258..1705722 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -2169,29 +2169,29 @@ GetMenuIndex( if ((string[0] == 'a') && (strcmp(string, "active") == 0)) { *indexPtr = menuPtr->active; - goto success; + return TCL_OK; } if ((string[0] == 'l') && (strcmp(string, "last") == 0)) { *indexPtr = menuPtr->numEntries - ((lastOK) ? 0 : 1); - goto success; + return TCL_OK; } if (string[0] == 0) { *indexPtr = TCL_INDEX_NONE; - goto success; + return TCL_OK; } #if !defined(TK_NO_DEPRECATED) && TK_MAJOR_VERSION < 9 if ((string[0] == 'n') && (strcmp(string, "none") == 0)) { *indexPtr = TCL_INDEX_NONE; - goto success; + return TCL_OK; } #endif if (string[0] == '@') { if (GetIndexFromCoords(interp, menuPtr, string, indexPtr) == TCL_OK) { - goto success; + return TCL_OK; } } @@ -2208,7 +2208,7 @@ GetMenuIndex( if ((label != NULL) && (Tcl_StringCaseMatch(label, string, 0))) { *indexPtr = i; - goto success; + return TCL_OK; } } @@ -2216,9 +2216,6 @@ GetMenuIndex( "bad menu entry index \"%s\"", string)); Tcl_SetErrorCode(interp, "TK", "MENU", "INDEX", NULL); return TCL_ERROR; - - success: - return TCL_OK; } /* -- cgit v0.12