[Liblas-commits] hg: Tidy up testing emptiness and indentation.
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Aug 17 17:24:48 EDT 2010
changeset 5de82dbc68a8 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=5de82dbc68a8
summary: Tidy up testing emptiness and indentation.
diffstat:
src/lasreader.cpp | 43 +++++++++++++++++--------------------------
1 files changed, 17 insertions(+), 26 deletions(-)
diffs (94 lines):
diff -r 35036dd06ad7 -r 5de82dbc68a8 src/lasreader.cpp
--- a/src/lasreader.cpp Tue Aug 17 14:56:48 2010 -0500
+++ b/src/lasreader.cpp Tue Aug 17 22:17:47 2010 +0100
@@ -176,9 +176,7 @@
if (m_transforms != 0 ) {
bHaveTransforms = true;
}
-
-
-
+
try {
// m_point = m_pimpl->ReadNextPoint(m_header).get();
m_point = const_cast<Point*>(&(m_pimpl->ReadNextPoint(m_header)));
@@ -193,22 +191,20 @@
}
if (bHaveTransforms) {
- if (m_transforms->size() != 0) {
- // Apply the transforms to each point
+ if (!m_transforms->empty()) {
+ // Apply the transforms to each point
- for (ti = m_transforms->begin(); ti != m_transforms->end(); ++ti) {
- liblas::TransformI* transform = *ti;
- transform->transform(*m_point);
-
- }
- }
+ for (ti = m_transforms->begin(); ti != m_transforms->end(); ++ti) {
+ liblas::TransformI* transform = *ti;
+ transform->transform(*m_point);
+ }
+ }
}
return true;
} catch (std::out_of_range) {
m_point = 0;
return false;
}
-
}
bool Reader::ReadPointAt(std::size_t n)
@@ -228,21 +224,18 @@
try {
m_point = const_cast<Point*>(&(m_pimpl->ReadPointAt(n, m_header)));
if (bHaveTransforms) {
- if (m_transforms->size() != 0) {
-
- for (ti = m_transforms->begin(); ti != m_transforms->end(); ++ti) {
- liblas::TransformI* transform = *ti;
- transform->transform(*m_point);
-
- }
- }
+ if (!m_transforms->empty()) {
+ for (ti = m_transforms->begin(); ti != m_transforms->end(); ++ti) {
+ liblas::TransformI* transform = *ti;
+ transform->transform(*m_point);
+ }
+ }
}
return true;
} catch (std::out_of_range) {
m_point = 0;
return false;
}
-
}
bool Reader::seek(std::size_t n)
@@ -349,10 +342,8 @@
// list if *that* isn't there).
TransformI* possible_reprojection_transform = 0;
- if (m_transforms != 0) {
- if (m_transforms->size() > 0) {
- possible_reprojection_transform = m_transforms->at(0);
- }
+ if (m_transforms != 0 && !m_transforms->empty()) {
+ possible_reprojection_transform = m_transforms->at(0);
}
if (m_reprojection_transform.get() == possible_reprojection_transform && m_reprojection_transform.get() != 0) {
@@ -365,7 +356,7 @@
m_reprojection_transform = TransformPtr(new ReprojectionTransform(m_in_srs, m_out_srs));
if (m_transforms != 0) {
- if (m_transforms->size() > 0) {
+ if (!m_transforms->empty()) {
// Insert the new reprojection transform to the beginning of the
// vector there are already transforms there.
m_transforms->insert(m_transforms->begin(), m_reprojection_transform.get());
More information about the Liblas-commits
mailing list