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-18 00:36:02 +0300
committerHans Goudey <h.goudey@me.com>2020-10-18 00:36:02 +0300
commitf425f40c4e17e889c720647b26c07ae3f6d3ba64 (patch)
treeb8b42d0862def239c0a05d2b3cae452aba68464d /source/blender/windowmanager/intern/wm_jobs.c
parent85e78fa17cd54676b5aa9a15a0b885b4a7187086 (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_jobs.c')
-rw-r--r--source/blender/windowmanager/intern/wm_jobs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index 189657f7aa3..361b3ed3d7f 100644
--- a/source/blender/windowmanager/intern/wm_jobs.c
+++ b/source/blender/windowmanager/intern/wm_jobs.c
@@ -159,24 +159,22 @@ static void wm_job_main_thread_yield(wmJob *wm_job)
*/
static wmJob *wm_job_find(wmWindowManager *wm, void *owner, const int job_type)
{
- wmJob *wm_job;
-
if (owner && job_type) {
- for (wm_job = wm->jobs.first; wm_job; wm_job = wm_job->next) {
+ LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) {
if (wm_job->owner == owner && wm_job->job_type == job_type) {
return wm_job;
}
}
}
else if (owner) {
- for (wm_job = wm->jobs.first; wm_job; wm_job = wm_job->next) {
+ LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) {
if (wm_job->owner == owner) {
return wm_job;
}
}
}
else if (job_type) {
- for (wm_job = wm->jobs.first; wm_job; wm_job = wm_job->next) {
+ LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) {
if (wm_job->job_type == job_type) {
return wm_job;
}