mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Dedupe code, call AISRecentEntries::find_by_mmsi().
This commit is contained in:
parent
3df003a678
commit
af8630a6f3
@ -101,9 +101,7 @@ void AISLogger::on_packet(const ais::Packet& packet) {
|
||||
|
||||
void AISRecentEntries::on_packet(const ais::Packet& packet) {
|
||||
const auto source_id = packet.source_id();
|
||||
auto matching_recent = std::find_if(entries.begin(), entries.end(),
|
||||
[source_id](const AISRecentEntry& entry) { return entry.mmsi == source_id; }
|
||||
);
|
||||
auto matching_recent = find_by_mmsi(source_id);
|
||||
if( matching_recent != entries.end() ) {
|
||||
// Found within. Move to front of list, increment counter.
|
||||
entries.push_front(*matching_recent);
|
||||
|
Loading…
Reference in New Issue
Block a user