summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorRadhey Parekh <radhey.parekh@gmail.com>2022-09-15 15:37:50 +0200
committerHossein <hossein@libreoffice.org>2022-09-15 18:07:06 +0200
commit51a780a26e4fbf339d4136ff0c7d75e01d6fad08 (patch)
treedba5e59afc259c4417a6d3c8f4b6ae589d61c420 /basegfx
parentc228803662d1d892405bf6431c4d5bd8dc22f7f6 (diff)
tdf#148251 Use std::swap() instead of using temporary values
Change-Id: Ifdf59f4957428efdc56009947f8c87f6b6351603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139273 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/workbench/gauss.hxx6
1 files changed, 1 insertions, 5 deletions
diff --git a/basegfx/source/workbench/gauss.hxx b/basegfx/source/workbench/gauss.hxx
index 3605c1cac9bd..4ef050ccbc52 100644
--- a/basegfx/source/workbench/gauss.hxx
+++ b/basegfx/source/workbench/gauss.hxx
@@ -47,8 +47,6 @@ bool eliminate( Matrix& matrix,
int cols,
const BaseType& minPivot )
{
- BaseType temp;
-
/* i, j, k *must* be signed, when looping like: j>=0 ! */
/* eliminate below main diagonal */
for(int i=0; i<cols-1; ++i)
@@ -66,9 +64,7 @@ bool eliminate( Matrix& matrix,
/* interchange rows 'max' and 'i' */
for(int k=0; k<cols; ++k)
{
- temp = matrix[ i*cols + k ];
- matrix[ i*cols + k ] = matrix[ max*cols + k ];
- matrix[ max*cols + k ] = temp;
+ std::swap(matrix[ i*cols + k ], matrix[ max*cols + k ]);
}
/* eliminate column */