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..
This commit is contained in:
Joshua Leung 2017-08-11 14:44:08 +12:00
parent fc016dca41
commit 043b156c83
1 changed files with 2 additions and 4 deletions

View File

@ -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();