]> git.lyx.org Git - lyx.git/commit
Pass DocumentClassConstPtr arguments by const reference
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 13 Sep 2024 12:16:21 +0000 (14:16 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 13 Sep 2024 12:16:21 +0000 (14:16 +0200)
commit58ee4c9ec74172b7600f1cc5d2299eba465496d7
tree40a3af6af253875b079fe8f2174fe9fce5d17e0b
parent3649cea9e59ecbf1c1831c54781a7aaff342714f
Pass DocumentClassConstPtr arguments by const reference

This arguments are shared_ptr objects, so they are not expensive to
copy. However, it makes sense to pass such pointers by const reference
when they are just intended for reading.

Some reading about this issue is here:
https://www.internalpointers.com/post/move-smart-pointers-and-out-functions-modern-c

Fixes some Coverity scan defects.
src/BufferParams.cpp
src/BufferParams.h
src/BufferView.cpp
src/BufferView.h
src/CutAndPaste.cpp
src/CutAndPaste.h