basegfx/source/workbench/gauss.hxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
New commits: commit 51a780a26e4fbf339d4136ff0c7d75e01d6fad08 Author: Radhey Parekh <radhey.par...@gmail.com> AuthorDate: Thu Sep 15 15:37:50 2022 +0200 Commit: Hossein <hoss...@libreoffice.org> CommitDate: Thu Sep 15 18:07:06 2022 +0200 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 <hoss...@libreoffice.org> 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 */