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_uilist_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_uilist_type.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_uilist_type.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_uilist_type.c b/source/blender/windowmanager/intern/wm_uilist_type.c index 801043a56d1..ef6d855cb36 100644 --- a/source/blender/windowmanager/intern/wm_uilist_type.c +++ b/source/blender/windowmanager/intern/wm_uilist_type.c @@ -38,10 +38,8 @@ static GHash *uilisttypes_hash = NULL; uiListType *WM_uilisttype_find(const char *idname, bool quiet) { - uiListType *ult; - if (idname[0]) { - ult = BLI_ghash_lookup(uilisttypes_hash, idname); + uiListType *ult = BLI_ghash_lookup(uilisttypes_hash, idname); if (ult) { return ult; } @@ -62,12 +60,11 @@ bool WM_uilisttype_add(uiListType *ult) void WM_uilisttype_freelink(uiListType *ult) { - bool ok; - ok = BLI_ghash_remove(uilisttypes_hash, ult->idname, NULL, MEM_freeN); + bool ok = BLI_ghash_remove(uilisttypes_hash, ult->idname, NULL, MEM_freeN); BLI_assert(ok); - (void)ok; + UNUSED_VARS_NDEBUG(ok); } /* called on initialize WM_init() */ @@ -79,7 +76,6 @@ void WM_uilisttype_init(void) void WM_uilisttype_free(void) { GHashIterator gh_iter; - GHASH_ITER (gh_iter, uilisttypes_hash) { uiListType *ult = BLI_ghashIterator_getValue(&gh_iter); if (ult->rna_ext.free) { |