[Libreoffice-commits] core.git: chart2/source
Muhammet Kara (via logerrit)
logerrit at kemper.freedesktop.org
Sun May 23 13:30:17 UTC 2021
chart2/source/view/charttypes/AreaChart.cxx | 3 +--
chart2/source/view/charttypes/BarChart.cxx | 3 +--
chart2/source/view/charttypes/NetChart.cxx | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
New commits:
commit 0253457e130442423210f99004d4c685fbff288f
Author: Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Sat May 22 21:09:28 2021 +0300
Commit: Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Sun May 23 15:29:35 2021 +0200
stlFindInsert: No unnecessary search before insertion to map
Change-Id: I7d1dc5d524a8a6f43f8371250d9e6f3c9c7a2589
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115995
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index a658a26d04a6..9421e94e6e9e 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -664,8 +664,7 @@ void AreaChart::createShapes()
{
std::map< sal_Int32, double >& rLogicYSumMap = aLogicYSumMapByX[nIndex];
sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
- if( rLogicYSumMap.find(nAttachedAxisIndex)==rLogicYSumMap.end() )
- rLogicYSumMap[nAttachedAxisIndex]=0.0;
+ rLogicYSumMap.insert({nAttachedAxisIndex, 0.0});
m_pPosHelper = &getPlottingPositionHelper(nAttachedAxisIndex);
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index a1de2d065003..ccdb6a9bc58d 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -518,8 +518,7 @@ void BarChart::createShapes()
for( auto& rXSlot : rZSlot )
{
sal_Int32 nAttachedAxisIndex = rXSlot.getAttachedAxisIndexForFirstSeries();
- if( aLogicYSumMap.find(nAttachedAxisIndex)==aLogicYSumMap.end() )
- aLogicYSumMap[nAttachedAxisIndex]=0.0;
+ aLogicYSumMap.insert({nAttachedAxisIndex, 0.0});
const sal_Int32 nSlotPoints = rXSlot.getPointCount();
if( nPointIndex >= nSlotPoints )
diff --git a/chart2/source/view/charttypes/NetChart.cxx b/chart2/source/view/charttypes/NetChart.cxx
index a8a0f776dd24..da270d37de48 100644
--- a/chart2/source/view/charttypes/NetChart.cxx
+++ b/chart2/source/view/charttypes/NetChart.cxx
@@ -369,8 +369,7 @@ void NetChart::createShapes()
pSeries->doSortByXValues();
sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
- if( aLogicYSumMap.find(nAttachedAxisIndex)==aLogicYSumMap.end() )
- aLogicYSumMap[nAttachedAxisIndex]=0.0;
+ aLogicYSumMap.insert({nAttachedAxisIndex, 0.0});
m_pPosHelper = &getPlottingPositionHelper(nAttachedAxisIndex);
More information about the Libreoffice-commits
mailing list