Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-10-17 09:28:34 +0300
committerHans Goudey <h.goudey@me.com>2020-10-17 09:28:34 +0300
commit7447eb7e7430b924deab74b8541b3f56a540a6e9 (patch)
treefe09abf4876d3ea80c94cc95626433160a64e3d9 /source/blender/windowmanager/intern/wm_panel_type.c
parent2c14a950a718b2a82d6f9da29bad038a2c91ec74 (diff)
Cleanup: Miscellaneous improvements in wm directory
- Reduce variable scope. - Use LISTBASE_FOREACH macros. - Return early in some cases to reduce to reduce indentation.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_panel_type.c')
-rw-r--r--source/blender/windowmanager/intern/wm_panel_type.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_panel_type.c b/source/blender/windowmanager/intern/wm_panel_type.c
index 1d2fecd0de6..24508c377a6 100644
--- a/source/blender/windowmanager/intern/wm_panel_type.c
+++ b/source/blender/windowmanager/intern/wm_panel_type.c
@@ -41,10 +41,8 @@ static GHash *g_paneltypes_hash = NULL;
PanelType *WM_paneltype_find(const char *idname, bool quiet)
{
- PanelType *pt;
-
if (idname[0]) {
- pt = BLI_ghash_lookup(g_paneltypes_hash, idname);
+ PanelType *pt = BLI_ghash_lookup(g_paneltypes_hash, idname);
if (pt) {
return pt;
}
@@ -65,12 +63,10 @@ bool WM_paneltype_add(PanelType *pt)
void WM_paneltype_remove(PanelType *pt)
{
- bool ok;
-
- ok = BLI_ghash_remove(g_paneltypes_hash, pt->idname, NULL, NULL);
+ const bool ok = BLI_ghash_remove(g_paneltypes_hash, pt->idname, NULL, NULL);
BLI_assert(ok);
- (void)ok;
+ UNUSED_VARS_NDEBUG(ok);
}
/* called on initialize WM_init() */