Le 18 déc. 2010 à 19:08, Abdelrazak Younes a écrit :

> On 18/12/2010 18:57, Jean-Marc Lasgouttes wrote:
>> Le 18 déc. 2010 à 17:41, Abdelrazak Younes a écrit :
>>>> What part of that could possibly go to branch?
>>> I guess introducing RandomListAccess::position() and using it will be 
>>> enough.
>> Why does this remove the quadratic behaviour?
> 
> distance(it1, it2) = paragraphs.position(it2) - paragraphs.position(it1);

But position() is linear, like std::distance().

> But as I said before, maybe the fix is as simple as this:
> -        if (distance(lastpar, par) >= distance(lastpar, endpar))
> +
> +        if (par == endpar)
>             break;

I thought this broke source view.

JMarc

Reply via email to