Re: Fwd: [PATCH][Bug 4212] appendix deleted when modifying first paragraph in appendix

2007-09-14 Thread Andre Poenitz
On Fri, Sep 14, 2007 at 03:44:50PM +0200, Helge Hafting wrote: > Alfredo Braunstein wrote: > >>> > >>>We have O(n) insertions/deletions like std::vector, std::list speed is > >>>O(1) > >>> > >>We use vector as the container for list::iterator not for the Paragraph > >>itself. insertion/delet

Re: Fwd: [PATCH][Bug 4212] appendix deleted when modifying first paragraph in appendix

2007-09-14 Thread Helge Hafting
Alfredo Braunstein wrote: We have O(n) insertions/deletions like std::vector, std::list speed is O(1) We use vector as the container for list::iterator not for the Paragraph itself. insertion/deletion of an iterator in a vector is cheap (fixed size element) so O(n) is OK. Insertion/delet

Re: Fwd: [PATCH][Bug 4212] appendix deleted when modifying first paragraph in appendix

2007-09-14 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Alfredo Braunstein" <[EMAIL PROTECTED]> writes: Both I guess. That being said, I am not religious about that, you can get rid of it if you find a proper replacement AFAIAC; but I don't think there is a need to optimize anything here. There is a lot more inefficient

Re: Fwd: [PATCH][Bug 4212] appendix deleted when modifying first paragraph in appendix

2007-09-14 Thread Jean-Marc Lasgouttes
"Alfredo Braunstein" <[EMAIL PROTECTED]> writes: >> Both I guess. That being said, I am not religious about that, you can >> get rid of it if you find a proper replacement AFAIAC; but I don't think >> there is a need to optimize anything here. There is a lot more >> inefficient stuff in the source

Fwd: [PATCH][Bug 4212] appendix deleted when modifying first paragraph in appendix

2007-09-13 Thread Alfredo Braunstein
Oops, sorry Abdel, I forgot to send to the list. > > Why? RandomAccessList::iterator is a std::list::iterator... > > Right but operator[] is fast. There was a fast iterator version once The code is full std::advance(pit, something) or boost::next(pit, something) that is currently O(n). That's why