[Bf-blender-cvs] [fc36c2f] master: simplify redundant conditionals
Mike Erwin
noreply at git.blender.org
Sun Jul 31 07:22:49 CEST 2016
Commit: fc36c2f70e13762bbd8e985a2e9435a0423a6db4
Author: Mike Erwin
Date: Sun Jul 31 01:22:36 2016 -0400
Branches: master
https://developer.blender.org/rBfc36c2f70e13762bbd8e985a2e9435a0423a6db4
simplify redundant conditionals
The redundant terms were harmless but check an expression we already
know to be true (from earlier in the same conditional).
Found by PVS-Studio T48917
===================================================================
M source/blender/editors/space_view3d/drawobject.c
M source/blender/modifiers/intern/MOD_fluidsim_util.c
M source/gameengine/Ketsji/KX_Scene.cpp
===================================================================
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 4320699..4739057 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -4663,7 +4663,7 @@ static bool drawDispList_nobackface(Scene *scene, View3D *v3d, RegionView3D *rv3
index3_nors_incr = true;
}
else {
- if (!render_only || (render_only && BKE_displist_has_faces(lb))) {
+ if (!render_only || BKE_displist_has_faces(lb)) {
return drawDispListwire(lb, ob->type);
}
}
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c
index 77fbb48..ffbbb1b 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim_util.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c
@@ -525,7 +525,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
return dm;
/* sanity check */
- if (!fluidmd || (fluidmd && !fluidmd->fss))
+ if (!fluidmd || !fluidmd->fss)
return dm;
fss = fluidmd->fss;
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index c0d99d1..b306108 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1665,7 +1665,7 @@ static void update_anim_thread_func(TaskPool *pool, void *taskdata, int UNUSED(t
// Only do deformers here if they are not parented to an armature, otherwise the armature will
// handle updating its children
- if (gameobj->GetDeformer() && (!parent || (parent && parent->GetGameObjectType() != SCA_IObject::OBJ_ARMATURE)))
+ if (gameobj->GetDeformer() && (!parent || parent->GetGameObjectType() != SCA_IObject::OBJ_ARMATURE))
gameobj->GetDeformer()->Update();
for (int j=0; j<children->GetCount(); ++j) {
More information about the Bf-blender-cvs
mailing list