summaryrefslogtreecommitdiff
path: root/tools/source/generic/poly.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-31 19:54:58 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-09-01 12:11:53 +0200
commit5f903bd3ad0619eb55941904d8a49b1e86d39e26 (patch)
treea7434aa9fa52bd37a024dd9b98ac843e72cc9e5b /tools/source/generic/poly.cxx
parentd19c5e0c60685b0a46cd92a6dac1463b8f90e602 (diff)
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.mcnamara@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'tools/source/generic/poly.cxx')
-rw-r--r--tools/source/generic/poly.cxx9
1 files changed, 8 insertions, 1 deletions
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 )