diff options
author | 2015-12-15 13:22:37 +0000 | |
---|---|---|
committer | 2015-12-15 13:22:37 +0000 | |
commit | 317be0349275f1f461028853d936670729591796 (patch) | |
tree | 2423d844a2f9ed9176f54ce5d07a368e248e9e6f /vpp | |
parent | ec65a1afd3f118849a7629d99ab2a1dcd2dda341 (diff) | |
parent | d2dc3df90d20419dfaee03f3096ed18d20fa391a (diff) |
Merge "replacing all vec_sort() invocations to vec_sort_with_function()"
Diffstat (limited to 'vpp')
-rw-r--r-- | vpp/api/api.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vpp/api/api.c b/vpp/api/api.c index a1e7f020..7bbb5c03 100644 --- a/vpp/api/api.c +++ b/vpp/api/api.c @@ -388,6 +388,15 @@ int vl_api_memclnt_delete_callback (u32 client_index) #define API_LINK_STATE_EVENT 1 #define API_ADMIN_UP_DOWN_EVENT 2 +static int +event_data_cmp (void * a1, void * a2) +{ + uword * e1 = a1; + uword * e2 = a2; + + return (word) e1[0] - (word) e2[0]; +} + static uword link_state_process (vlib_main_t * vm, vlib_node_runtime_t * rt, @@ -414,7 +423,7 @@ link_state_process (vlib_main_t * vm, (vm, &event_data, API_ADMIN_UP_DOWN_EVENT); /* Sort, so we can eliminate duplicates */ - vec_sort (event_data, e1, e2, (word) e1[0] - (word) e2[0]); + vec_sort_with_function (event_data, event_data_cmp); prev_sw_if_index = ~0; |