mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-13 12:12:16 -04:00
Use std::begin(), std::end() where appropriate.
This commit is contained in:
parent
af8630a6f3
commit
8efeb049ca
1 changed files with 2 additions and 2 deletions
|
@ -102,7 +102,7 @@ void AISLogger::on_packet(const ais::Packet& packet) {
|
||||||
void AISRecentEntries::on_packet(const ais::Packet& packet) {
|
void AISRecentEntries::on_packet(const ais::Packet& packet) {
|
||||||
const auto source_id = packet.source_id();
|
const auto source_id = packet.source_id();
|
||||||
auto matching_recent = find_by_mmsi(source_id);
|
auto matching_recent = find_by_mmsi(source_id);
|
||||||
if( matching_recent != entries.end() ) {
|
if( matching_recent != std::end(entries) ) {
|
||||||
// Found within. Move to front of list, increment counter.
|
// Found within. Move to front of list, increment counter.
|
||||||
entries.push_front(*matching_recent);
|
entries.push_front(*matching_recent);
|
||||||
entries.erase(matching_recent);
|
entries.erase(matching_recent);
|
||||||
|
@ -151,7 +151,7 @@ void AISRecentEntries::on_packet(const ais::Packet& packet) {
|
||||||
|
|
||||||
AISRecentEntries::ContainerType::const_iterator AISRecentEntries::find_by_mmsi(const ais::MMSI key) const {
|
AISRecentEntries::ContainerType::const_iterator AISRecentEntries::find_by_mmsi(const ais::MMSI key) const {
|
||||||
return std::find_if(
|
return std::find_if(
|
||||||
begin(), end(),
|
std::begin(entries), std::end(entries),
|
||||||
[key](const AISRecentEntry& e) { return e.mmsi == key; }
|
[key](const AISRecentEntry& e) { return e.mmsi == key; }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue