Fix cppcheck and compiler warnings

This commit is contained in:
Mat Sutcliffe
2020-06-18 23:48:58 +01:00
parent 9309beefc4
commit 670b1a1986
61 changed files with 131 additions and 153 deletions

View File

@@ -1436,18 +1436,16 @@ namespace BlackCore
bool canLikelySkipNearGround = correctedSituation.canLikelySkipNearGroundInterpolation();
do
{
if (canLikelySkipNearGround || correctedSituation.hasGroundElevation()) { break; }
// set a defined state
correctedSituation.resetGroundElevation();
// Check if we can bail out and ignore all elevation handling
//
// rational:
// a) elevation handling is expensive, and might even requests elevation from sim.
// b) elevations not needed pollute the cache with "useless" values
//
if (canLikelySkipNearGround) { break; }
if (canLikelySkipNearGround || correctedSituation.hasGroundElevation()) { break; }
// set a defined state
correctedSituation.resetGroundElevation();
// Guessing gives better values, also for smaller planes
// and avoids unnecessary elevation fetching for low flying smaller GA aircraft