summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-05-14 10:55:16 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-05-14 12:03:09 +0200
commit5449a798d1e676ce8bef876270226eaea602f258 (patch)
tree8890aa5258a889002bf9d8de43ec31df77679e7b /chart2/source
parent43f81f1ed3e98202d440f17509b8d008fab51ce3 (diff)
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@yahoo.fr>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/view/main/VDataSeries.cxx9
1 files changed, 5 insertions, 4 deletions
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