1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 02:51:31 -08:00

Removing unnecessary case of splaying empty trees.

Copied from Perforce
 Change: 184450
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Brooksby 2014-02-23 11:52:21 +00:00
parent 1ac9877082
commit 42a8ffbe6a
3 changed files with 109 additions and 134 deletions

View file

@ -828,8 +828,6 @@ Bool CBSFindLargest(Range rangeReturn, Range oldRangeReturn,
CBS cbs, Size size, FindDelete findDelete)
{
Bool found = FALSE;
Tree root;
Bool notEmpty;
AVERT(CBS, cbs);
cbsEnter(cbs);
@ -839,14 +837,13 @@ Bool CBSFindLargest(Range rangeReturn, Range oldRangeReturn,
AVER(cbs->fastFind);
AVERT(FindDelete, findDelete);
notEmpty = SplayRoot(&root, treeOfCBS(cbs));
if (notEmpty) {
if (!SplayTreeIsEmpty(treeOfCBS(cbs))) {
RangeStruct range;
CBSBlock block;
Tree node = NULL; /* suppress "may be used uninitialized" */
Size maxSize;
maxSize = cbsBlockOfNode(root)->maxSize;
maxSize = cbsBlockOfNode(SplayTreeRoot(treeOfCBS(cbs)))->maxSize;
if (maxSize >= size) {
METER_ACC(cbs->treeSearch, cbs->treeSize);
found = SplayFindFirst(&node, treeOfCBS(cbs), &cbsTestNode,