SplayNode<V> *result = splay(dataToRemove, compare);
- if (splayLastResult == 0) { /* found it */
+ if (splayLastResult == 0) { /* found it */
SplayNode<V> *newTop;
if (result->left == NULL) {
return newTop;
}
- return result; /* It wasn't there */
+ return result; /* It wasn't there */
}
template<class V>
break;
if ((splayLastResult = compare(dataToFind, top->left->data)) < 0) {
- y = top->left; /* rotate right */
+ y = top->left; /* rotate right */
top->left = y->right;
y->right = top;
top = y;
break;
}
- r->left = top; /* link right */
+ r->left = top; /* link right */
r = top;
top = top->left;
} else if (splayLastResult > 0) {
break;
if ((splayLastResult = compare(dataToFind, top->right->data)) > 0) {
- y = top->right; /* rotate left */
+ y = top->right; /* rotate left */
top->right = y->left;
y->left = top;
top = y;
break;
}
- l->right = top; /* link left */
+ l->right = top; /* link left */
l = top;
top = top->right;
} else {
}
}
- l->right = top->left; /* assemble */
+ l->right = top->left; /* assemble */
r->left = top->right;
top->left = N.right;
top->right = N.left;
#endif /* cplusplus */
#endif /* SQUID_SPLAY_H */
+