diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2021-05-22 21:09:28 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2021-05-23 15:29:35 +0200 |
commit | 0253457e130442423210f99004d4c685fbff288f (patch) | |
tree | fb5c7647a3fd3b3f033dd6ab127bb0999662a4e1 /chart2 | |
parent | e85c7952845a8b64af1104f279c0d2bb045270db (diff) |
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@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/charttypes/AreaChart.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/charttypes/BarChart.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/charttypes/NetChart.cxx | 3 |
3 files changed, 3 insertions, 6 deletions
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); |