From af8630a6f38a81f400153fc62b2cecd06f4ff5e6 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 13 Jan 2016 18:04:50 -0800 Subject: [PATCH] Dedupe code, call AISRecentEntries::find_by_mmsi(). --- firmware/application/ais_app.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/firmware/application/ais_app.cpp b/firmware/application/ais_app.cpp index 8d86e339..a2238e26 100644 --- a/firmware/application/ais_app.cpp +++ b/firmware/application/ais_app.cpp @@ -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);