diff options
author | Hans Goudey <h.goudey@me.com> | 2020-10-18 00:36:02 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-10-18 00:36:02 +0300 |
commit | f425f40c4e17e889c720647b26c07ae3f6d3ba64 (patch) | |
tree | b8b42d0862def239c0a05d2b3cae452aba68464d /source/blender/windowmanager/intern/wm_menu_type.c | |
parent | 85e78fa17cd54676b5aa9a15a0b885b4a7187086 (diff) |
Cleanup: More miscellaneous code quality changes in wm directory
- Declare variables where initialized.
- Use LISTBASE_FOREACH macro.
- Reduce variable scope.
- Return early or reduce indentation in some cases.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_menu_type.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_menu_type.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_menu_type.c b/source/blender/windowmanager/intern/wm_menu_type.c index dc4efe79433..0c52e636e4d 100644 --- a/source/blender/windowmanager/intern/wm_menu_type.c +++ b/source/blender/windowmanager/intern/wm_menu_type.c @@ -41,10 +41,8 @@ static GHash *menutypes_hash = NULL; MenuType *WM_menutype_find(const char *idname, bool quiet) { - MenuType *mt; - if (idname[0]) { - mt = BLI_ghash_lookup(menutypes_hash, idname); + MenuType *mt = BLI_ghash_lookup(menutypes_hash, idname); if (mt) { return mt; } @@ -71,12 +69,10 @@ bool WM_menutype_add(MenuType *mt) void WM_menutype_freelink(MenuType *mt) { - bool ok; - - ok = BLI_ghash_remove(menutypes_hash, mt->idname, NULL, MEM_freeN); + bool ok = BLI_ghash_remove(menutypes_hash, mt->idname, NULL, MEM_freeN); BLI_assert(ok); - (void)ok; + UNUSED_VARS_NDEBUG(ok); } /* called on initialize WM_init() */ |