Resolve TODOs in level_2_chunks

This commit is contained in:
AdenKoperczak 2025-05-07 17:16:42 -04:00
parent 3d7da7d971
commit 4906800a22
No known key found for this signature in database
GPG key ID: 9843017036F62EE7
2 changed files with 10 additions and 13 deletions

View file

@ -405,7 +405,6 @@ AwsLevel2ChunksDataProvider::Impl::ListObjects()
if (possibleLastNumbers.empty())
{
logger_->warn("Could not find last scan");
// TODO make sure this makes sence
return {false, 0, 0};
}
@ -705,7 +704,6 @@ std::pair<size_t, size_t> AwsLevel2ChunksDataProvider::Refresh()
if (p->lastScan_.nexradFile_ != nullptr)
{
p->lastScan_.hasAllFiles_ = true;
// TODO maybe set lastModified for timing
}
}
// Fall back to chunks if files did not load

View file

@ -528,7 +528,6 @@ bool Ar2vFile::IndexFile()
return true;
}
// TODO not good
// NOLINTNEXTLINE
bool IsRadarDataIncomplete(
const std::shared_ptr<const rda::ElevationScan>& radarData)
@ -583,10 +582,10 @@ Ar2vFile::Ar2vFile(const std::shared_ptr<Ar2vFile>& current,
std::shared_ptr<rda::ElevationScan> secondMostRecent = nullptr;
// check if this volume scan has an earlier elevation scan
auto maybe = elevation.second.rbegin(); // TODO name
++maybe;
auto possibleSecondMostRecent = elevation.second.rbegin();
++possibleSecondMostRecent;
if (maybe == elevation.second.rend())
if (possibleSecondMostRecent == elevation.second.rend())
{
if (last == nullptr)
{
@ -613,7 +612,7 @@ Ar2vFile::Ar2vFile(const std::shared_ptr<Ar2vFile>& current,
}
else
{
secondMostRecent = maybe->second;
secondMostRecent = possibleSecondMostRecent->second;
}
// Make the new scan
@ -707,15 +706,15 @@ Ar2vFile::Ar2vFile(const std::shared_ptr<Ar2vFile>& current,
// Start below any reasonable elevation
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
float highestCurrentElevation = -90;
const auto& maybe1 = p->index_.find(type.first);
if (maybe1 != p->index_.cend())
const auto& elevationScans = p->index_.find(type.first);
if (elevationScans != p->index_.cend())
{
const auto& maybe2 = maybe1->second.crbegin();
if (maybe2 != maybe1->second.crend())
const auto& highestElevation = elevationScans->second.crbegin();
if (highestElevation != elevationScans->second.crend())
{
// Add a slight offset to ensure good floating point compare.
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
highestCurrentElevation = maybe2->first + 0.01f;
highestCurrentElevation = highestElevation->first + 0.01f;
}
}