On Sun, Dec 18, 2005 at 01:05:57PM +0100, Lars Gullik Bjønnes wrote:
> Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> | I did try map in the way Angus proposed, it works and is cleaner than
> | vector. (I don't know, and don't really care, if it is faster. Not
> | critical.)
> 
> A the vector will have O(1) lookup, the map O(log n).

n being the number of rows in a paragraph. In other words, not critical
;-)

...
 
> [...] 
> 
> | +           // If selection is on, the current row signature differs from
> | +           // from cache, or cursor is inside an inset _on this row_, 
> | +           // then paint the row
> | +           if (select || par.rowSignature()[rowno] != row_sig 
> | +                      || cur_in_inset_in_row) {
> 
> Remember here that par.rowSignature()[rowno] will insert a new
> element in the map. (Also note that the operator[] does not exist for
> const map)

Yes, that has tripped me up a few times earlier.
 
> Also I'd like to se a way to get rid of the rowno variable, but I
> guess that would slow thinks dows a bit...
> (or perhaps just very little)
> 
> rowno == std::distance(beg, rit); // rowList.begin() - rowList::iterator

Doable, but _really_ low priority, if you ask me.

- Martin 

Attachment: pgpYc0E9bBP9x.pgp
Description: PGP signature

Reply via email to