picoquic/picosplay.c
static void rotate(picosplay_node_t *child) {
    picosplay_node_t *parent = child->parent;
    assert(parent != NULL);
    if(parent->left == child) { /* A left child given. */
        mark_gp(child);
        parent->left = child->right;
        if(child->right != NULL)
            child->right->parent = parent;
        child->right = parent;
    } else { /* A right child given. */ 
        mark_gp(child);
        parent->right = child->left;
        if(child->left != NULL)
            child->left->parent = parent;
        child->left = parent;
    }
}
/* Rotate to make the given child take its parent's place in the tree. */
Rotate to make the given child take its parent's place in the tree.
Rotate to make the given child take its parent ' s place in the tree .
static void rotate(picosplay_node_t *child) {
    picosplay_node_t *parent = child->parent;
    assert(parent != NULL);
    if(parent->left == child) { 
        mark_gp(child);
        parent->left = child->right;
        if(child->right != NULL)
            child->right->parent = parent;
        child->right = parent;
    } else {  
        mark_gp(child);
        parent->right = child->left;
        if(child->left != NULL)
            child->left->parent = parent;
        child->left = parent;
    }
}
static void rotate ( picosplay_node_t * child ) { picosplay_node_t * parent = child -> parent ; assert ( parent != NULL ) ; if ( parent -> left == child ) { mark_gp ( child ) ; parent -> left = child -> right ; if ( child -> right != NULL ) child -> right -> parent = parent ; child -> right = parent ; } else { mark_gp ( child ) ; parent -> right = child -> left ; if ( child -> left != NULL ) child -> left -> parent = parent ; child -> left = parent ; } }
Rotate to make the given child take its parent's place in the tree.
Rotate to make the given child take its parent ' s place in the tree .
/* A left child given. */ /* A right child given. */