summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-09-21 15:28:12 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-09-21 17:06:05 +0200
commit4e738b824d825717b7c6b895d816dcac1adf08e1 (patch)
tree46126754bce7d081f0347c483ccdc961ecdcaee7 /basegfx
parentc1ee70dba2c8da567feeeb276fddf5f726863a81 (diff)
basegfx: remove global ImplB2DPolyPolygon
Similar to commit 7e911e9cd469d30369c213aa529675b3f7c4f0e8 Author Michael Stahl <mstahl@redhat.com> Date Fri Aug 25 20:51:22 2017 +0200 basegfx: remove global ImplB2DPolygon There shouldn't be allocations of the objects just to destroy them without populating with data (it there are, they should be optimized away); and for any reasonable use, defaulting to a shared instance means that there is an unnecessary refcount increase and decrease aside from inevitable allocation of the unique instance. Change-Id: Ia92c229165c0836e56778d9274f0728181048e8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140341 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b2dpolypolygon.cxx9
1 files changed, 2 insertions, 7 deletions
diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx
index 1889ddae4220..547634dc4dad 100644
--- a/basegfx/source/polygon/b2dpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dpolypolygon.cxx
@@ -211,10 +211,7 @@ public:
}
};
- static o3tl::cow_wrapper<ImplB2DPolyPolygon, o3tl::ThreadSafeRefCountingPolicy> DEFAULT;
-
- B2DPolyPolygon::B2DPolyPolygon() :
- mpPolyPolygon(DEFAULT) {}
+ B2DPolyPolygon::B2DPolyPolygon() = default;
B2DPolyPolygon::B2DPolyPolygon(const B2DPolyPolygon&) = default;
@@ -301,9 +298,7 @@ public:
B2DPolyPolygon aRetval;
if (count())
{
- // Avoid CoW overhead for the local variable
- // But detach from shared static DEFAULT
- ImplB2DPolyPolygon& dest = aRetval.mpPolyPolygon.make_unique();
+ ImplB2DPolyPolygon& dest = *aRetval.mpPolyPolygon;
dest.reserve(count());
for (sal_uInt32 a(0); a < count(); a++)