tools/inc/poly.h | 1 + tools/source/generic/poly.cxx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-)
New commits: commit 5f903bd3ad0619eb55941904d8a49b1e86d39e26 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Aug 31 19:54:58 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Sep 1 12:11:53 2024 +0200 ofz#70815 optimize this a little #5 0x558251409124 in operator new[](unsigned long) /src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:98:3 #6 0x558255fb4937 in ImplPolygon::ImplPolygon(ImplPolygon const&) /src/libreoffice/tools/source/generic/poly.cxx:74:26 #7 0x558255fbbfd3 in impl_t /src/libreoffice/include/o3tl/cow_wrapper.hxx:195:17 #8 0x558255fbbfd3 in cow_wrapper /src/libreoffice/include/o3tl/cow_wrapper.hxx:236:26 #9 0x558255fbbfd3 in tools::Polygon::Polygon(tools::Rectangle const&) /src/libreoffice/tools/source/generic/poly.cxx:887:53 shouldn't need to create a copy here Change-Id: I44122aaca0b49f31dd85e95920c9911b96e4227f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172706 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/tools/inc/poly.h b/tools/inc/poly.h index 4a3139570aac..d1187d5251c1 100644 --- a/tools/inc/poly.h +++ b/tools/inc/poly.h @@ -34,6 +34,7 @@ public: ImplPolygon( sal_uInt16 nInitSize ); ImplPolygon( sal_uInt16 nPoints, const Point* pPtAry, const PolyFlags* pInitFlags ); ImplPolygon( const ImplPolygon& rImplPoly ); + ImplPolygon( ImplPolygon&& rImplPoly ); ImplPolygon( const tools::Rectangle& rRect ); ImplPolygon( const tools::Rectangle& rRect, sal_uInt32 nHorzRound, sal_uInt32 nVertRound); ImplPolygon( const Point& rCenter, tools::Long nRadX, tools::Long nRadY ); diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index d3c71bf20f8c..8026f238773a 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -81,7 +81,14 @@ ImplPolygon::ImplPolygon( const ImplPolygon& rImpPoly ) } } - mnPoints = rImpPoly.mnPoints; + mnPoints = rImpPoly.mnPoints; +} + +ImplPolygon::ImplPolygon(ImplPolygon&& rImpPoly) +{ + mxPointAry = std::move(rImpPoly.mxPointAry); + mxFlagAry = std::move(rImpPoly.mxFlagAry); + mnPoints = rImpPoly.mnPoints; } ImplPolygon::ImplPolygon( sal_uInt16 nInitSize, const Point* pInitAry, const PolyFlags* pInitFlags )