aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/linkedlists.h
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-23 15:11:46 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-23 15:11:46 +0000
commit8f2fabe64f24fdfd17dcc34773bdb2adb1ef1b7e (patch)
treeeadb7c681e0fecd6f7d64f2cfe5c72dedc2cd7c3 /include/asterisk/linkedlists.h
parentbda9898fe134a95231748b1419ad951f413aaf08 (diff)
Speed up ast_list macros (bug #3135)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4546 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/linkedlists.h')
-rwxr-xr-xinclude/asterisk/linkedlists.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h
index 75f0aa2cf..c9bc7502d 100755
--- a/include/asterisk/linkedlists.h
+++ b/include/asterisk/linkedlists.h
@@ -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; \