diff options
author | Joshua Leung <aligorith@gmail.com> | 2017-08-11 05:44:08 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2017-08-11 15:05:58 +0300 |
commit | 043b156c83e56d8b1abd66e996c16fa53e65b0b6 (patch) | |
tree | 17e68cdf4cb66d5a983f335af3f6cf20b26d7a47 /source/blender | |
parent | fc016dca418f489925c3924e5d70baebdfddfc91 (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')
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 6 |
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(); |