mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-21 05:07:41 +00:00
ADSB RX App cleanup (#1569)
* WIP refactoring/gardening * WIP cleanup, adding status dots * Rename ageStep * WIP Cleanup * Wrapping up ADSB refactor/cleanup. * Don't initialize strings to " " * Better map refresh * Fix colorization of recent entries * Fit and finish
This commit is contained in:
@@ -24,13 +24,13 @@
|
||||
|
||||
#include "ui_widget.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
#include <utility>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <utility>
|
||||
|
||||
template <class Entry>
|
||||
using RecentEntries = std::list<Entry>;
|
||||
@@ -42,6 +42,13 @@ typename ContainerType::const_iterator find(const ContainerType& entries, const
|
||||
[key](typename ContainerType::const_reference e) { return e.key() == key; });
|
||||
}
|
||||
|
||||
template <typename ContainerType, typename Key>
|
||||
typename ContainerType::iterator find(ContainerType& entries, const Key key) {
|
||||
return std::find_if(
|
||||
std::begin(entries), std::end(entries),
|
||||
[key](typename ContainerType::const_reference e) { return e.key() == key; });
|
||||
}
|
||||
|
||||
template <typename ContainerType>
|
||||
static void truncate_entries(ContainerType& entries, const size_t entries_max = 64) {
|
||||
while (entries.size() > entries_max) {
|
||||
|
Reference in New Issue
Block a user