diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-24 14:09:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-24 15:48:51 +0000 |
commit | 3a74745367a73ed9351379fc32bbe9253cdae697 (patch) | |
tree | 0fec3ca84576a0f51e4f48cdda82b67e7282c3ab /basegfx | |
parent | c9126dfbabcde1bf8b157942a5f5134ad547b957 (diff) |
vector::data seems more natural than &vector::front
Change-Id: I0ce48075ad186cf1f9bd3e13fa76269fa9819af1
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygon.cxx | 16 | ||||
-rw-r--r-- | basegfx/source/polygon/b3dpolypolygon.cxx | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx index f1032f108a86..9c6b1eb50fe9 100644 --- a/basegfx/source/polygon/b2dpolypolygon.cxx +++ b/basegfx/source/polygon/b2dpolypolygon.cxx @@ -137,34 +137,34 @@ public: const basegfx::B2DPolygon* begin() const { - if(maPolygons.empty()) + if (maPolygons.empty()) return nullptr; else - return &maPolygons.front(); + return maPolygons.data(); } const basegfx::B2DPolygon* end() const { - if(maPolygons.empty()) + if (maPolygons.empty()) return nullptr; else - return (&maPolygons.back())+1; + return maPolygons.data() + maPolygons.size(); } basegfx::B2DPolygon* begin() { - if(maPolygons.empty()) + if (maPolygons.empty()) return nullptr; else - return &maPolygons.front(); + return maPolygons.data(); } basegfx::B2DPolygon* end() { - if(maPolygons.empty()) + if (maPolygons.empty()) return nullptr; else - return &(maPolygons.back())+1; + return maPolygons.data() + maPolygons.size(); } }; diff --git a/basegfx/source/polygon/b3dpolypolygon.cxx b/basegfx/source/polygon/b3dpolypolygon.cxx index 74c8b835298a..9aa8c7809982 100644 --- a/basegfx/source/polygon/b3dpolypolygon.cxx +++ b/basegfx/source/polygon/b3dpolypolygon.cxx @@ -155,34 +155,34 @@ public: const basegfx::B3DPolygon* begin() const { - if(maPolygons.empty()) + if (maPolygons.empty()) return nullptr; else - return &maPolygons.front(); + return maPolygons.data(); } const basegfx::B3DPolygon* end() const { - if(maPolygons.empty()) + if (maPolygons.empty()) return nullptr; else - return (&maPolygons.back())+1; + return maPolygons.data() + maPolygons.size(); } basegfx::B3DPolygon* begin() { - if(maPolygons.empty()) + if (maPolygons.empty()) return nullptr; else - return &maPolygons.front(); + return maPolygons.data(); } basegfx::B3DPolygon* end() { - if(maPolygons.empty()) + if (maPolygons.empty()) return nullptr; else - return &(maPolygons.back())+1; + return maPolygons.data() + maPolygons.size(); } }; |