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:
parent
1ac9877082
commit
42a8ffbe6a
3 changed files with 109 additions and 134 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue