aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/outofflowmgr.cc33
1 files changed, 19 insertions, 14 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc
index 343a8b0f..7d92d957 100644
--- a/dw/outofflowmgr.cc
+++ b/dw/outofflowmgr.cc
@@ -188,29 +188,34 @@ int OutOfFlowMgr::SortedFloatsVector::findFloatIndex (Textblock *lastGB,
Float::CompareGBAndExtIndex cmp (oofm);
int i = bsearch (&key, false, &cmp);
- //printf ("[%p] findFloatIndex (%p, %d) => i = %d (of %d)\n",
- // oofm->containingBlock, lastGB, lastExtIndex, i, size ());
-
- //for (int i = 0; i < size (); i++) {
- // Float *f = get(i);
- // TBInfo *t = oofm->getTextblock(f->generatingBlock);
- // printf (" %d: (%p [%d, %p], %d)\n", i, f->generatingBlock,
- // t->index, t->parent ? t->parent->textblock : NULL,
- // get(i)->externalIndex);
- //}
-
// At position i is the next larger element, so element i should
// not included, but i - 1 returned; except if the exact element is
// found: then include it and so return i.
+ int r;
if (i == size())
- return i - 1;
+ r = i - 1;
else {
Float *f = get (i);
if (cmp.compare (f, &key) == 0)
- return i;
+ r = i;
else
- return i - 1;
+ r = i - 1;
}
+
+ //printf ("[%p] findFloatIndex (%p, %d) => i = %d, r = %d (size = %d); "
+ // "in %s list %p on the %s side\n",
+ // oofm->containingBlock, lastGB, lastExtIndex, i, r, size (),
+ // type == GB ? "GB" : "CB", this, side == LEFT ? "left" : "right");
+
+ //for (int i = 0; i < size (); i++) {
+ // Float *f = get(i);
+ // TBInfo *t = oofm->getTextblock(f->generatingBlock);
+ // printf (" %d: (%p [%d, %p], %d)\n", i, f->generatingBlock,
+ // t->index, t->parent ? t->parent->textblock : NULL,
+ // get(i)->externalIndex);
+ //}
+
+ return r;
}
int OutOfFlowMgr::SortedFloatsVector::find (Textblock *textblock, int y,