|
From: Julian S. <js...@ac...> - 2008-01-21 13:01:51
|
> Yea... And we probably need to export one more FM method:
> + while (HG_(nextIterFM)( map_locks, (Word*)&gla, (Word*)&lk )
> + && compareFM(map_locks, gla,lastA) <= 0) { // use the comparison
> function from map_locks
Urr. You're right. That's ugly. That means 2 function calls per
element now.
Maybe it would be easier to have this:
// unchanged -- set up for unbounded iteration
initIterFM( WordFM* fm )
// change this back to the original version
nextIterFM( WordFM* fm, UWord* key, UWord* val)
// set up for bounded iteration, first value >= notBelow
initBoundedIterFM( WordFM* fm, UWord notBelow )
// get next value, except stop if > notAbove
nextBoundedIterFM( WordFM* fm, UWord notAbove, UWord* key, UWord* val )
That removes the extra compareFM call.
J
|