From e0ec131ea3e38559c291667631dfb64d0f3f4055 Mon Sep 17 00:00:00 2001 From: Rei Date: Wed, 17 Sep 2014 20:23:23 +0200 Subject: [PATCH] Remove unwanted check in appendFragmentToFrame(). - This is a double check. - Only fragments can be used with this function. - Check before if the frame contains a payload fragment! --- RPi/RF24Network/RF24Network.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/RPi/RF24Network/RF24Network.cpp b/RPi/RF24Network/RF24Network.cpp index 885fcf0e..611147c1 100644 --- a/RPi/RF24Network/RF24Network.cpp +++ b/RPi/RF24Network/RF24Network.cpp @@ -254,13 +254,6 @@ bool RF24Network::enqueue(RF24NetworkFrame frame) { void RF24Network::appendFragmentToFrame(RF24NetworkFrame frame) { - bool isFragment = ( frame.header.type == NETWORK_FIRST_FRAGMENT || frame.header.type == NETWORK_MORE_FRAGMENTS || frame.header.type == NETWORK_LAST_FRAGMENT ); - - if (!isFragment) { - //The received payload is not a fragment. - frameFragmentsCache[ std::make_pair(frame.header.from_node,frame.header.id) ] = frame; - } else - if (frameFragmentsCache.count(std::make_pair(frame.header.from_node,frame.header.id)) == 0 ) { // This is the first of many fragments.