Simplify new macro, simplify configfile logic, now that list is sorted

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-03-26 19:58:09 +00:00
parent 352ca6584b
commit e04025ead9
2 changed files with 13 additions and 32 deletions

View File

@@ -712,15 +712,12 @@ struct { \
prev = cur; \
cur = cur->field.next; \
} \
if (!prev) { /* Same as INSERT_HEAD */ \
(elm)->field.next = (head)->first; \
(head)->first = (elm); \
} else if (!cur) { /* Same as INSERT_TAIL */ \
(head)->last->field.next = (elm); \
(head)->last = (elm); \
if (!prev) { \
AST_LIST_INSERT_HEAD(head, elm, field); \
} else if (!cur) { \
AST_LIST_INSERT_TAIL(head, elm, field); \
} else { \
(elm)->field.next = cur; \
(prev)->field.next = (elm); \
AST_LIST_INSERT_AFTER(head, prev, elm, field); \
} \
} \
} while (0)