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:02:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2014-11-16 16:06:03 +0300
commit0e60accf2afa4fc69da99743bb64d82cb3e0fbc4 (patch)
tree7013c96248c881481287eb84f8de715f1f0563f2 /source/blender/blenlib/BLI_listbase.h
parent7d040d2a088ec425550da4242650f1ff75680e0d (diff)
BLI_listbase: Add BLI_listbase_count_ex (sets a limit)
This can be used to avoid redundant looping when we only want to know if a list is smaller then some size. also remove paranoid NULL check in list counting.
Diffstat (limited to 'source/blender/blenlib/BLI_listbase.h')
-rw-r--r--source/blender/blenlib/BLI_listbase.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h
index 543a662c5e5..2e01f743f9e 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -70,6 +70,7 @@ void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewl
void BLI_listbase_sort(struct ListBase *listbase, int (*cmp)(const void *, const void *)) ATTR_NONNULL(1, 2);
void BLI_listbase_sort_r(ListBase *listbase, void *thunk, int (*cmp)(void *, const void *, const void *)) ATTR_NONNULL(1, 3);
void BLI_freelist(struct ListBase *listbase) ATTR_NONNULL(1);
+int BLI_listbase_count_ex(const struct ListBase *listbase, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1);