From 8ef934c73f3baeaa582efb8de906b27a3854979c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 26 Aug 2013 23:37:08 +0000 Subject: ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it takes a key as an arg and isnt popping any element from the hash as you might expect). add BLI_pophead/tail, since getting the first element from a list and removing it is a common task. --- source/blender/editors/space_graph/graph_select.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_graph') diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index cbec3072c44..aaaafa93bb0 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1049,10 +1049,7 @@ static tNearestVertInfo *get_best_nearest_fcurve_vert(ListBase *matches) /* if list only has 1 item, remove it from the list and return */ if (matches->first == matches->last) { /* need to remove from the list, otherwise it gets freed and then we can't return it */ - nvi = matches->first; - BLI_remlink(matches, nvi); - - return nvi; + return BLI_pophead(matches); } /* try to find the first selected F-Curve vert, then take the one after it */ @@ -1075,9 +1072,7 @@ static tNearestVertInfo *get_best_nearest_fcurve_vert(ListBase *matches) /* if we're still here, this means that we failed to find anything appropriate in the first pass, * so just take the first item now... */ - nvi = matches->first; - BLI_remlink(matches, nvi); - return nvi; + return BLI_pophead(matches); } /* Find the nearest vertices (either a handle or the keyframe) that are nearest to the mouse cursor (in area coordinates) -- cgit v1.2.3