diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-05-31 11:53:04 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-06-01 15:38:01 -0700 |
commit | 8b37a0704c7c20b1664fee3dfcc79139982a1ce7 (patch) | |
tree | 9c0a50330b7e4f152a3a9ee25685fcbe8b9a4df4 /include/mbgl/style/conversion/source.hpp | |
parent | 843da07b28a840fd850056c4b15d492ccc76a646 (diff) | |
download | qtlocation-mapboxgl-8b37a0704c7c20b1664fee3dfcc79139982a1ce7.tar.gz |
[core] Use fixed-size std::array for ImageSource coordinates
Diffstat (limited to 'include/mbgl/style/conversion/source.hpp')
-rw-r--r-- | include/mbgl/style/conversion/source.hpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/mbgl/style/conversion/source.hpp b/include/mbgl/style/conversion/source.hpp index e121e36955..e0563ac10b 100644 --- a/include/mbgl/style/conversion/source.hpp +++ b/include/mbgl/style/conversion/source.hpp @@ -170,14 +170,13 @@ private: return {}; } - std::vector<LatLng> coordinates; - coordinates.reserve(4); - for( std::size_t i=0; i < arrayLength(*coordinatesValue); i++) { + std::array<LatLng, 4> coordinates; + for (std::size_t i=0; i < 4; i++) { auto latLng = conversion::convert<LatLng>(arrayMember(*coordinatesValue,i), error); if (!latLng) { return {}; } - coordinates.push_back(*latLng); + coordinates[i] = *latLng; } auto result = std::make_unique<ImageSource>(id, coordinates); result->setURL(*urlString); |