Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Waypoint: eliminate DebugFlag overhead if NDEBUG

An empty class such as DebugFlag always consumes at least one byte, as
mandated by the C++ standard.
  • Loading branch information...
commit a30ce1cef7f9b3e1baefb12740a0dde411908e64 1 parent 7768e9c
@MaxKellermann MaxKellermann authored
View
3  src/Engine/Waypoint/Waypoint.cpp
@@ -53,5 +53,8 @@ void
Waypoint::Project(const TaskProjection &task_projection)
{
flat_location = task_projection.project(location);
+
+#ifndef NDEBUG
flat_location_initialised = true;
+#endif
}
View
2  src/Engine/Waypoint/Waypoint.hpp
@@ -99,7 +99,9 @@ struct Waypoint {
/** Flat projected location */
FlatGeoPoint flat_location;
+#ifndef NDEBUG
DebugFlag flat_location_initialised;
+#endif
/** Height AMSL (m) of waypoint terrain */
fixed elevation;
Please sign in to comment.
Something went wrong with that request. Please try again.