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:
authorJoshua Leung <aligorith@gmail.com>2017-08-11 05:44:08 +0300
committerJoshua Leung <aligorith@gmail.com>2017-08-11 15:05:58 +0300
commit043b156c83e56d8b1abd66e996c16fa53e65b0b6 (patch)
tree17e68cdf4cb66d5a983f335af3f6cf20b26d7a47 /source/blender/editors/space_nla
parentfc016dca418f489925c3924e5d70baebdfddfc91 (diff)
Code Cleanup: Use utility function here
There's no reason to manually iterate over items in a DLRBT_Tree, as the structure is designed to be able to be safely casted down to a ListBase and ListBase-like nodes..
Diffstat (limited to 'source/blender/editors/space_nla')
-rw-r--r--source/blender/editors/space_nla/nla_draw.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 33ac5d50a01..fbb05025adf 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -135,10 +135,8 @@ static void nla_action_draw_keyframes(AnimData *adt, bAction *act, float y, floa
immUnbindProgram();
/* count keys before drawing */
- unsigned int key_ct = 0;
- for (ActKeyColumn *ak = keys.first; ak; ak = ak->next) {
- key_ct++;
- }
+ /* Note: It's safe to cast DLRBT_Tree, as it's designed to degrade down to a ListBase */
+ unsigned int key_ct = BLI_listbase_count((ListBase *)&keys);
if (key_ct > 0) {
format = immVertexFormat();