mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-05 17:40:51 +00:00
Refactor MQTT::onReceive to reduce if/else nesting (#5592)
* Refactor MQTT::onReceive to reduce if/else nesting * Fix missing #include <functional> * const DecodedServiceEnvelope e * Combine validDecode if statement. * Only call pb_release when validDecode. * s/ptr/channelName/ * Use reference type for deleter * Use lambda instead of bind * Document deleter * Reorder 'if's to avoid object creation * Remove unnecessary comment * Remove 'else'; simpifies #5516 --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -44,6 +44,7 @@ typedef int ErrorCode;
|
||||
|
||||
/// Alloc and free packets to our global, ISR safe pool
|
||||
extern Allocator<meshtastic_MeshPacket> &packetPool;
|
||||
using UniquePacketPoolPacket = Allocator<meshtastic_MeshPacket>::UniqueAllocation;
|
||||
|
||||
/**
|
||||
* Most (but not always) of the time we want to treat packets 'from' the local phone (where from == 0), as if they originated on
|
||||
|
||||
Reference in New Issue
Block a user