From 4d502ef3559f53d75e4ee3c85b90ea36816049e8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 26 Feb 2019 12:07:24 +0200 Subject: loplugin:simplifybool improve search for negated operator Change-Id: Id6ac35fefa5c3e1f64c222713791e849b3cb4d34 Reviewed-on: https://gerrit.libreoffice.org/68379 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- basegfx/source/polygon/b2dpolypolygon.cxx | 10 +--------- basegfx/source/polygon/b3dpolygon.cxx | 12 ++++++------ 2 files changed, 7 insertions(+), 15 deletions(-) (limited to 'basegfx/source') diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx index 14e2d17c6bde..bbdc54a15481 100644 --- a/basegfx/source/polygon/b2dpolypolygon.cxx +++ b/basegfx/source/polygon/b2dpolypolygon.cxx @@ -81,15 +81,7 @@ public: bool operator==(const ImplB2DPolyPolygon& rPolygonList) const { - // same polygon count? - if(maPolygons.size() != rPolygonList.maPolygons.size()) - return false; - - // compare polygon content - if(!(maPolygons == rPolygonList.maPolygons)) - return false; - - return true; + return maPolygons == rPolygonList.maPolygons; } const basegfx::B2DPolygon& getB2DPolygon(sal_uInt32 nIndex) const diff --git a/basegfx/source/polygon/b3dpolygon.cxx b/basegfx/source/polygon/b3dpolygon.cxx index 41f5add1f434..9817fb43f6fb 100644 --- a/basegfx/source/polygon/b3dpolygon.cxx +++ b/basegfx/source/polygon/b3dpolygon.cxx @@ -1316,17 +1316,17 @@ public: const sal_uInt32 nIndex(maPoints.count() - 1); bRemove = (maPoints.getCoordinate(0) == maPoints.getCoordinate(nIndex)); - if(bRemove && mpBColors && !(mpBColors->getBColor(0) == mpBColors->getBColor(nIndex))) + if(bRemove && mpBColors && mpBColors->getBColor(0) != mpBColors->getBColor(nIndex)) { bRemove = false; } - if(bRemove && mpNormals && !(mpNormals->getNormal(0) == mpNormals->getNormal(nIndex))) + if(bRemove && mpNormals && mpNormals->getNormal(0) != mpNormals->getNormal(nIndex)) { bRemove = false; } - if(bRemove && mpTextureCoordinates && !(mpTextureCoordinates->getTextureCoordinate(0) == mpTextureCoordinates->getTextureCoordinate(nIndex))) + if(bRemove && mpTextureCoordinates && mpTextureCoordinates->getTextureCoordinate(0) != mpTextureCoordinates->getTextureCoordinate(nIndex)) { bRemove = false; } @@ -1352,17 +1352,17 @@ public: const sal_uInt32 nNextIndex(nIndex + 1); bool bRemove(maPoints.getCoordinate(nIndex) == maPoints.getCoordinate(nNextIndex)); - if(bRemove && mpBColors && !(mpBColors->getBColor(nIndex) == mpBColors->getBColor(nNextIndex))) + if(bRemove && mpBColors && mpBColors->getBColor(nIndex) != mpBColors->getBColor(nNextIndex)) { bRemove = false; } - if(bRemove && mpNormals && !(mpNormals->getNormal(nIndex) == mpNormals->getNormal(nNextIndex))) + if(bRemove && mpNormals && mpNormals->getNormal(nIndex) != mpNormals->getNormal(nNextIndex)) { bRemove = false; } - if(bRemove && mpTextureCoordinates && !(mpTextureCoordinates->getTextureCoordinate(nIndex) == mpTextureCoordinates->getTextureCoordinate(nNextIndex))) + if(bRemove && mpTextureCoordinates && mpTextureCoordinates->getTextureCoordinate(nIndex) != mpTextureCoordinates->getTextureCoordinate(nNextIndex)) { bRemove = false; } -- cgit