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:
authorCampbell Barton <ideasman42@gmail.com>2014-11-16 16:23:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2014-11-16 16:23:37 +0300
commitc31f74de6bb7938ce0e36f75caeedfa16ac90b53 (patch)
treea1f10b56b9e6c06f4a66287ba16b5eced9fdb4c4 /source/blender/blenlib/intern/listbase.c
parent0e60accf2afa4fc69da99743bb64d82cb3e0fbc4 (diff)
Cleanup: use BLI_listbase_count_ex to avoid redundant looping
Diffstat (limited to 'source/blender/blenlib/intern/listbase.c')
-rw-r--r--source/blender/blenlib/intern/listbase.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index ea33b9b1e3b..bd3e1e0bbb0 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -372,6 +372,11 @@ void BLI_freelistN(ListBase *listbase)
BLI_listbase_clear(listbase);
}
+/**
+ * Returns the number of elements in \a listbase, up until (and including count_max)
+ *
+ * \note Use to avoid redundant looping.
+ */
int BLI_listbase_count_ex(const ListBase *listbase, const int count_max)
{
Link *link;