summaryrefslogtreecommitdiff
path: root/tools/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-23 11:59:41 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-23 21:53:08 +0100
commitde694ba260e1b48ca06ea88c03f8f5f97ac4990e (patch)
tree87737eb3b0a8156ec2f4322912bb31af92d1b5d1 /tools/source
parent6b75c472cb93a635403317f937df4f543d9b82cf (diff)
Point default ctor already zero-initializes the members
Change-Id: I9cb59c77a420c975933070eea691cda52b066b0b Reviewed-on: https://gerrit.libreoffice.org/48397 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'tools/source')
-rw-r--r--tools/source/generic/poly.cxx6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index ce1156bac990..3c78b5a04bc8 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -496,7 +496,6 @@ void ImplPolygon::ImplInitSize(sal_uInt16 nInitSize, bool bFlags)
if (nInitSize)
{
mxPointAry.reset(new Point[nInitSize]);
- memset(mxPointAry.get(), 0, nInitSize * sizeof(Point));
}
if (bFlags)
@@ -525,9 +524,8 @@ void ImplPolygon::ImplSetSize( sal_uInt16 nNewSize, bool bResize )
// Copy the old points
if ( mnPoints < nNewSize )
{
- // New points initialized to zero
+ // New points are already implicitly initialized to zero
const std::size_t nOldSz(mnPoints * sizeof(Point));
- memset(xNewAry.get() + mnPoints, 0, nNewSz - nOldSz);
if (mxPointAry)
memcpy(xNewAry.get(), mxPointAry.get(), nOldSz);
}
@@ -606,8 +604,6 @@ bool ImplPolygon::ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon con
if( pInitPoly )
memcpy(xNewAry.get() + nPos, pInitPoly->mxPointAry.get(), nSpaceSize);
- else
- memset(xNewAry.get() + nPos, 0, nSpaceSize);
memcpy(xNewAry.get() + nSecPos, mxPointAry.get() + nPos, nRest * sizeof(Point));
mxPointAry = std::move(xNewAry);