diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 14:29:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 21:43:49 +0200 |
commit | 05f47e6d9f0c442e481b2435cc5c2ef615ab347a (patch) | |
tree | bfa2c4c29007a63d42a227456f2fc6717e79ccb3 /vcl | |
parent | f9b104abc1185d4f9f3af66f49ec9e39f85a1c36 (diff) |
replace 'resize(size+1)' with emplace_back
which is considerably faster if we're dealing with a std::list, and just
easier on the eyes if we're dealing with a std::vector
Change-Id: I373689205ebc048689f29ab80a7ee8551b20cc96
Reviewed-on: https://gerrit.libreoffice.org/39816
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/opengl/RenderList.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pngwrite.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/vcl/inc/opengl/RenderList.hxx b/vcl/inc/opengl/RenderList.hxx index 062971ec29f3..6188203c77ea 100644 --- a/vcl/inc/opengl/RenderList.hxx +++ b/vcl/inc/opengl/RenderList.hxx @@ -95,7 +95,7 @@ private: { if (maRenderEntries.empty() || doesOverlap(rDrawRectangle)) { - maRenderEntries.resize(maRenderEntries.size() + 1); + maRenderEntries.emplace_back(); maRenderEntries.back().maOverlapTrackingRectangle = rDrawRectangle; maRectangles.clear(); diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx index c3f07eb06538..ccc4b50d71e7 100644 --- a/vcl/source/gdi/pngwrite.cxx +++ b/vcl/source/gdi/pngwrite.cxx @@ -656,7 +656,7 @@ void PNGWriterImpl::ImplClearFirstScanline() void PNGWriterImpl::ImplOpenChunk (sal_uLong nChunkType) { - maChunkSeq.resize(maChunkSeq.size() + 1); + maChunkSeq.emplace_back(); maChunkSeq.back().nType = nChunkType; } |