mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +00:00
Speed up ast_list macros (bug #3135)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -62,13 +62,15 @@ struct { \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define AST_LIST_REMOVE_HEAD(head, field) do { \
|
||||
#define AST_LIST_REMOVE_HEAD(head, type, field) ({ \
|
||||
struct type *cur = (head)->first; \
|
||||
(head)->first = (head)->first->field.next; \
|
||||
} while (0)
|
||||
cur; \
|
||||
})
|
||||
|
||||
#define AST_LIST_REMOVE(head, elm, type, field) do { \
|
||||
if ((head)->first == (elm)) { \
|
||||
AST_LIST_REMOVE_HEAD((head), field); \
|
||||
AST_LIST_REMOVE_HEAD((head), type, field); \
|
||||
} \
|
||||
else { \
|
||||
struct type *curelm = (head)->first; \
|
||||
|
Reference in New Issue
Block a user