mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Ref T259, Ref T243 improved handling of removig outdated parts
This commit is contained in:
@@ -134,8 +134,12 @@ namespace BlackMisc
|
||||
{
|
||||
// remove all outdated parts, but keep at least one
|
||||
if (partsList.isEmpty()) { return; }
|
||||
const qint64 ts = partsList.front().getMSecsSinceEpoch() - MaxPartsAgePerCallsignSecs * 1000;
|
||||
|
||||
// we expect the latest value at front
|
||||
// but to make sure we do the search
|
||||
const qint64 ts = partsList.latestTimestampMsecsSinceEpoch() - MaxPartsAgePerCallsignSecs * 1000;
|
||||
partsList.removeBefore(ts);
|
||||
Q_ASSERT_X(partsList.size() >= 1, Q_FUNC_INFO, "Need at least 1 value");
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user