[Liblas-commits] hg: Avoid potential double allocation of buffer - allocate on co...

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Jul 30 10:56:35 EDT 2010


changeset afefe3d8c1a0 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=afefe3d8c1a0
summary: Avoid potential double allocation of buffer - allocate on construction instead

diffstat:

 src/detail/reader/header.cpp |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (13 lines):

diff -r 6a15d6ae9cee -r afefe3d8c1a0 src/detail/reader/header.cpp
--- a/src/detail/reader/header.cpp	Fri Jul 30 09:16:58 2010 -0500
+++ b/src/detail/reader/header.cpp	Fri Jul 30 16:00:11 2010 +0100
@@ -373,8 +373,7 @@
 
         uint16_t length = vlrh.recordLengthAfterHeader;
 
-        std::vector<uint8_t> data;
-        data.resize(length);
+        std::vector<uint8_t> data(length);
 
         read_n(data.front(), m_ifs, length);
          


More information about the Liblas-commits mailing list