Changeset 16


Ignore:
Timestamp:
Jan 13, 2006, 9:42:48 PM (19 years ago)
Author:
rainer
Message:

minor optimization in zAVLtree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/zAVLTree.c

    r1 r16  
    123123    node = zAVLCloseSearchNode(avltree, newnode->key, &ok);
    124124
    125     if (!zAVLKey_cmp(avltree, node->key, newnode->key)) {
     125    if (ok == ZAVL_OK) { /* exists already */
    126126      free(newnode);
    127127      return 3;
     
    191191
    192192  avlnode = zAVLCloseSearchNode(avltree, key, &ok);
    193   if (avlnode == NULL || zAVLKey_cmp(avltree, avlnode->key, key))
     193  if (avlnode == NULL || ok == ZAVL_NO) /* does not exist */
    194194    return -1;
    195195
Note: See TracChangeset for help on using the changeset viewer.