[Liblas-commits] hg: don't make extra copy of point data

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Jan 5 12:02:02 EST 2011


details:   http://hg.liblas.orghg/rev/e55dd32bf150
changeset: 2692:e55dd32bf150
user:      Howard Butler <hobu.inc at gmail.com>
date:      Wed Jan 05 11:01:56 2011 -0600
description:
don't make extra copy of point data

diffstat:

 src/detail/reader/zipreader.cpp |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 08b635c9ab58 -r e55dd32bf150 src/detail/reader/zipreader.cpp
--- a/src/detail/reader/zipreader.cpp	Wed Jan 05 10:47:10 2011 -0600
+++ b/src/detail/reader/zipreader.cpp	Wed Jan 05 11:01:56 2011 -0600
@@ -216,13 +216,16 @@
 
     if (recordPoint)
     {
-        std::vector<boost::uint8_t> v(m_zipPoint->m_lz_point_size);
+        std::vector<boost::uint8_t>& data = m_point->GetData();
+        assert(m_zipPoint->m_lz_point_size == data.size());
+        
+        // std::vector<boost::uint8_t> v(m_zipPoint->m_lz_point_size);
         for (unsigned int i=0; i<m_zipPoint->m_lz_point_size; i++)
         {
-            v[i] = m_zipPoint->m_lz_point_data[i];
+            data[i] = m_zipPoint->m_lz_point_data[i];
             //printf("%d %d\n", v[i], i);
         }
-        m_point->SetData(v);
+        // m_point->SetData(v);
 
         ++m_current;
     }
@@ -383,4 +386,4 @@
 
 }} // namespace liblas::detail
 
-#endif // HAVE_LASZIP
+#endif // HAVE_LASZIP


More information about the Liblas-commits mailing list