[Libreoffice-commits] core.git: include/drawinglayer

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 9 18:21:21 UTC 2020


 include/drawinglayer/primitive2d/Primitive2DContainer.hxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 4ec7dee3e33cf70abdce9d9de936a9694344d402
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Apr 9 11:08:47 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Apr 9 20:20:45 2020 +0200

    tdf#104878 avoid extra deque allocations for empty Primitive2DContainer
    
    Change-Id: I9815ef38928d4c93485d69c131be6f7df32daef1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91954
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
index 4b852f340a14..cca3a0a91485 100644
--- a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
@@ -39,7 +39,11 @@ class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer
       public Primitive2DDecompositionVisitor
 {
 public:
-    explicit Primitive2DContainer() {}
+    // use zero because we allocate a lot of empty containers
+    explicit Primitive2DContainer()
+        : deque(0)
+    {
+    }
     explicit Primitive2DContainer(size_type count)
         : deque(count)
     {


More information about the Libreoffice-commits mailing list