[Libreoffice-commits] libcdr.git: src/lib

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 9 07:25:11 UTC 2019


 src/lib/CDROutputElementList.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4b28c1a10f06e0a610d0a740b8a5839dcec9dae4
Author:     Albert Astals Cid <aacid at kde.org>
AuthorDate: Sat Oct 5 18:48:28 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Oct 9 09:24:54 2019 +0200

    CDROutputElementList::draw: Micro perfomance improvement
    
    make the auto variable of the for loop const &, otherwise there's a copy
    involved. Copying a shared_ptr is not very expensive but not copying it
    is cheaper :)
    
    Change-Id: I861e8b58441b45e2e7aa045e2aa7c0521c73ebbe
    Reviewed-on: https://gerrit.libreoffice.org/80303
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/src/lib/CDROutputElementList.cpp b/src/lib/CDROutputElementList.cpp
index 001f9dc..c970bd6 100644
--- a/src/lib/CDROutputElementList.cpp
+++ b/src/lib/CDROutputElementList.cpp
@@ -351,7 +351,7 @@ CDROutputElementList::~CDROutputElementList()
 
 void CDROutputElementList::draw(librevenge::RVNGDrawingInterface *painter) const
 {
-  for (auto element : m_elements)
+  for (const auto &element : m_elements)
     element->draw(painter);
 }
 


More information about the Libreoffice-commits mailing list