[Bf-blender-cvs] [6f81acd] multiview: cleanup: use empty checks instead of counting

Campbell Barton noreply at git.blender.org
Mon Nov 24 13:06:44 CET 2014


Commit: 6f81acd7f986539cbc62effb8b0bf235b4b1849a
Author: Campbell Barton
Date:   Mon Nov 24 13:06:52 2014 +0100
Branches: multiview
https://developer.blender.org/rB6f81acd7f986539cbc62effb8b0bf235b4b1849a

cleanup: use empty checks instead of counting

===================================================================

M	source/blender/blenkernel/intern/image.c
M	source/blender/nodes/composite/nodes/node_composite_switchview.c

===================================================================

diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index d98d788..551ef25 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -4266,12 +4266,12 @@ int BKE_image_sequence_guess_offset(Image *image)
 
 bool BKE_image_has_anim(Image *ima)
 {
-	return (BLI_listbase_count_ex(&ima->anims, 1) > 0) && (((ImageAnim *) ima->anims.first)->anim != NULL);
+	return (!BLI_listbase_is_empty(&ima->anims)) && (((ImageAnim *) ima->anims.first)->anim != NULL);
 }
 
 bool BKE_image_has_packedfile(Image *ima)
 {
-	return (BLI_listbase_count_ex(&ima->packedfiles, 1) > 0) && (((ImagePackedFile *) ima->packedfiles.first)->packedfile != NULL);
+	return (!BLI_listbase_is_empty(&ima->packedfiles)) && (((ImagePackedFile *) ima->packedfiles.first)->packedfile != NULL);
 }
 
 /**
diff --git a/source/blender/nodes/composite/nodes/node_composite_switchview.c b/source/blender/nodes/composite/nodes/node_composite_switchview.c
index eefb081..f4bc632 100644
--- a/source/blender/nodes/composite/nodes/node_composite_switchview.c
+++ b/source/blender/nodes/composite/nodes/node_composite_switchview.c
@@ -49,7 +49,7 @@ static void cmp_node_switch_view_sanitycheck(bNodeTree *ntree, bNode *node)
 {
 	bNodeSocket *sock;
 
-	if (BLI_listbase_count_ex(&node->inputs, 1) > 0)
+	if (!BLI_listbase_is_empty(&node->inputs))
 		return;
 
 	sock = ntreeCompositSwitchViewAddSocket(ntree, node, "No View");




More information about the Bf-blender-cvs mailing list