]> git.lyx.org Git - lyx.git/commit
Get rid of lyx::next uses for RandomAccessList
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 11 May 2020 10:31:25 +0000 (12:31 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 14 May 2020 08:35:49 +0000 (10:35 +0200)
commitfc5b22a2f1009538abbfb335f2afe97ef16e433a
treea70f1856ae20f41e0f56fbc96b0d35087e7f42a7
parent97bbcf2b9b65f17c91bf89d509dbd161f4015abd
Get rid of lyx::next uses for RandomAccessList

These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.

Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added. Additionally, the
method retirns end() when position is equal to the size of the
container (see #11861).

lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
src/Compare.cpp
src/CutAndPaste.cpp
src/Text.cpp
src/Text2.cpp
src/Text3.cpp
src/output_docbook.cpp
src/output_latex.cpp
src/output_xhtml.cpp
src/support/RandomAccessList.h
src/support/lyxalgo.h