From 7c796593d347210ec8da2ba80b4483d261ef8f05 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 27 Sep 2013 17:11:22 +0000 Subject: astobj2: Remove OBJ_CONTINUE support. OBJ_CONTINUE was a strange feature that came into the world under suspicious circumstances to support an abuse of the ao2_container by chan_iax2. Since chan_iax2 no longer uses OBJ_CONTINUE, it is safe to remove it. The simplified code should help performance slightly and make understanding the code easier. Review: https://reviewboard.asterisk.org/r/2887/ ........ Merged revisions 399937 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399938 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/astobj2.h | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) (limited to 'include') diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h index 073197d47..9129c4b67 100644 --- a/include/asterisk/astobj2.h +++ b/include/asterisk/astobj2.h @@ -895,34 +895,6 @@ enum search_flags { * result of of the callback function has the CMP_STOP bit set. */ OBJ_MULTIPLE = (1 << 2), - /*! - * \brief Continue if a match is not found. - * - * \details - * This flag forces a whole container search. The - * OBJ_SEARCH_OBJECT, OBJ_SEARCH_KEY, and OBJ_SEARCH_PARTIAL_KEY - * flags just specify where to start the search in the - * container. If the search is not stopped early then the - * search _continues_ until the search wraps around to the - * starting point. - * - * Normal searches start where the search key specifies to start - * and end when the search key indicates that the object is not - * in the container. - * - * For hash containers, this tells the ao2_callback() core to - * keep searching through the rest of the buckets if a match is - * not found in the starting bucket defined by the hash value on - * the argument. - * - * For rbtree containers, if the search key is not in the - * container, the search will start either at the first item - * before the search key or the first item after the search key. - * - * \note The supplied ao2_callback_fn is called for every node - * in the container from the starting point. - */ - OBJ_CONTINUE = (1 << 3), /*! * \brief Assume that the ao2_container is already locked. * @@ -1127,6 +1099,8 @@ typedef int (ao2_callback_data_fn)(void *obj, void *arg, void *data, int flags); * OBJ_SEARCH_OBJECT - if set, 'obj', is an object. * OBJ_SEARCH_KEY - if set, 'obj', is a search key item that is not an object. * + * \note This function must be idempotent. + * * \return Computed hash value. */ typedef int (ao2_hash_fn)(const void *obj, int flags); @@ -1141,6 +1115,8 @@ typedef int (ao2_hash_fn)(const void *obj, int flags); * OBJ_SEARCH_KEY - if set, 'obj_right', is a search key item that is not an object. * OBJ_SEARCH_PARTIAL_KEY - if set, 'obj_right', is a partial search key item that is not an object. * + * \note This function must be idempotent. + * * \retval <0 if obj_left < obj_right * \retval =0 if obj_left == obj_right * \retval >0 if obj_left > obj_right -- cgit v1.2.3