/* Remove node 'x' from the tree. This function shall not be called if node 'x' is not part of the tree.  */
static void remove_node(br_ssl_session_cache_lru *cc, uint32_t x)
/* Remove node 'x' from the tree. This function shall not be called if node 'x' is not part of the tree.  */
static void remove_node(br_ssl_session_cache_lru *cc, uint32_t x)
{
	uint32_t alx, y, aly;
	find_node(cc, cc->store + x + SESSION_ID_OFF, &alx);
	y = find_replacement_node(cc, x, &aly);
	if (y != ADDR_NULL) {
		uint32_t z;
		z = get_left(cc, y);
		if (z == ADDR_NULL) {
			z = get_right(cc, y);
		}
		set_link(cc, aly, z);
		set_link(cc, alx, y);
		set_left(cc, y, get_left(cc, x));
		set_right(cc, y, get_right(cc, x));
	} else {
		set_link(cc, alx, ADDR_NULL);
	}
}