[Libreoffice-commits] core.git: chart2/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Fri May 14 10:03:47 UTC 2021


 chart2/source/view/main/VDataSeries.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 5449a798d1e676ce8bef876270226eaea602f258
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Fri May 14 10:55:16 2021 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Fri May 14 12:03:09 2021 +0200

    Avoid temporary var + directly initialize vector in VDataSeries.cxx
    
    Change-Id: Ief280ca4cb2cdadfc41f7c98bdec4044475c7daf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115588
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 545254ecfccc..247fe41a2d27 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -277,10 +277,11 @@ void VDataSeries::doSortByXValues()
     sal_Int32 nPointIndex = 0;
     for( nPointIndex=0; nPointIndex < m_nPointCount; nPointIndex++ )
     {
-        std::vector< double > aSinglePoint;
-        aSinglePoint.push_back( (nPointIndex < m_aValues_X.Doubles.getLength()) ? m_aValues_X.Doubles[nPointIndex] : fNan );
-        aSinglePoint.push_back( (nPointIndex < m_aValues_Y.Doubles.getLength()) ? m_aValues_Y.Doubles[nPointIndex] : fNan );
-        aTmp.push_back( aSinglePoint );
+        aTmp.push_back(
+                        { ((nPointIndex < m_aValues_X.Doubles.getLength()) ? m_aValues_X.Doubles[nPointIndex] : fNan),
+                          ((nPointIndex < m_aValues_Y.Doubles.getLength()) ? m_aValues_Y.Doubles[nPointIndex] : fNan)
+                        }
+                      );
     }
 
     //do sort


More information about the Libreoffice-commits mailing list