summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhasso <hasso>2003-12-22 16:49:15 +0000
committerhasso <hasso>2003-12-22 16:49:15 +0000
commit47ce02a8f12134a6ba515fbf1d2b9276e39d4c06 (patch)
tree1fb92612024ca80abdfb9a99af42866340a4dc05
parent76398034067abd80e174fea9d0d6c619de7cc679 (diff)
Revert my "microfix". It was caused by misreading code. Gilad is right as
always.
-rw-r--r--ChangeLog5
-rw-r--r--lib/linklist.c7
2 files changed, 6 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 635d47de..02f28d4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-22 Hasso Tepper <hasso@estpak.ee>
+
+ * lib/linklist.c: Revert microfix I commited while reverting
+ [quagga-dev 227]. Caused by misreading code.
+
2003-12-21 Hasso Tepper <hasso@estpak.ee>
* lib/linklist.c: Revert patch [quagga-dev 227]. listnode_add_sort()
diff --git a/lib/linklist.c b/lib/linklist.c
index 9c1b297a..1c95da4a 100644
--- a/lib/linklist.c
+++ b/lib/linklist.c
@@ -85,10 +85,6 @@ listnode_add (struct list *list, void *val)
* cmp function, insert a new node with the given val such that the
* list remains sorted. The new node is always inserted; there is no
* notion of omitting duplicates.
- *
- * XXX not sure this is right:
- * It is currently undefined whether new nodes for which cmp returns 0
- * should be added before or after any existing nodes.
*/
void
listnode_add_sort (struct list *list, void *val)
@@ -103,8 +99,7 @@ listnode_add_sort (struct list *list, void *val)
{
for (n = list->head; n; n = n->next)
{
- /* XXX should an "equal" node be inserted before or after? */
- if ((*list->cmp) (val, n->data) <= 0)
+ if ((*list->cmp) (val, n->data) < 0)
{
new->next = n;
new->prev = n->prev;