diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-16 16:23:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-16 16:23:37 +0300 |
commit | c31f74de6bb7938ce0e36f75caeedfa16ac90b53 (patch) | |
tree | a1f10b56b9e6c06f4a66287ba16b5eced9fdb4c4 /source/blender/blenlib/intern/listbase.c | |
parent | 0e60accf2afa4fc69da99743bb64d82cb3e0fbc4 (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.c | 5 |
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; |