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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 3 08:17:25 UTC 2021


 chart2/source/view/charttypes/VSeriesPlotter.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit a9a648fbf47f94151de0d525e432b45919ba7504
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Thu Sep 2 19:52:55 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 3 10:16:51 2021 +0200

    no need to allocate SeriesMinMaxType separately
    
    Change-Id: I7121375a6bf731f8d30f69aa8c90b102675a8bb4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121531
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index b5bfc8d871b0..dd3fec5bd61a 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1970,7 +1970,7 @@ class PerXMinMaxCalculator
 {
     typedef std::pair<double, double> MinMaxType;
     typedef std::map<size_t, MinMaxType> SeriesMinMaxType;
-    typedef std::map<double, std::unique_ptr<SeriesMinMaxType>> GroupMinMaxType;
+    typedef std::map<double, SeriesMinMaxType> GroupMinMaxType;
     typedef std::unordered_map<double, MinMaxType> TotalStoreType;
     GroupMinMaxType m_SeriesGroup;
     size_t mnCurSeries;
@@ -2042,7 +2042,7 @@ private:
         {
             double fX = it.first;
 
-            const SeriesMinMaxType& rSeries = *it.second;
+            const SeriesMinMaxType& rSeries = it.second;
             for (auto const& series : rSeries)
             {
                 double fYMin = series.second.first, fYMax = series.second.second;
@@ -2069,7 +2069,7 @@ private:
         if (it == m_SeriesGroup.end())
         {
             std::pair<GroupMinMaxType::iterator,bool> r =
-                m_SeriesGroup.insert(std::make_pair(fX, std::make_unique<SeriesMinMaxType>()));
+                m_SeriesGroup.insert(std::make_pair(fX, SeriesMinMaxType{}));
 
             if (!r.second)
                 // insertion failed.
@@ -2078,7 +2078,7 @@ private:
             it = r.first;
         }
 
-        return it->second.get();
+        return &it->second;
     }
 };
 


More information about the Libreoffice-commits mailing list