Skip to content

Commit

Permalink
Remove boost::lambda from transportsender.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcallister authored and keithw committed Apr 15, 2012
1 parent 8bc9aa3 commit 8369497
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/network/transportsender.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <boost/lambda/lambda.hpp>
#include <algorithm>
#include <list>
#include <stdio.h>
Expand All @@ -26,7 +25,6 @@
#include "transportsender.h"
#include "transportfragment.h"

using namespace boost::lambda;
using namespace Network;
using namespace std;

Expand Down Expand Up @@ -312,9 +310,10 @@ void TransportSender<MyState>::process_acknowledgment_through( uint64_t ack_num
{
/* Ignore ack if we have culled the state it's acknowledging */

if ( sent_states.end() != find_if( sent_states.begin(), sent_states.end(),
(&_1)->*&TimestampedState<MyState>::num == ack_num ) ) {
sent_states.remove_if( (&_1)->*&TimestampedState<MyState>::num < ack_num );
if ( sent_states.end() !=
find_if( sent_states.begin(), sent_states.end(),
bind2nd( mem_fun_ref( &TimestampedState<MyState>::num_eq ), ack_num ) ) ) {
sent_states.remove_if( bind2nd( mem_fun_ref( &TimestampedState<MyState>::num_lt ), ack_num ) );
}

assert( !sent_states.empty() );
Expand Down
4 changes: 4 additions & 0 deletions src/network/transportstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ namespace Network {
TimestampedState( uint64_t s_timestamp, uint64_t s_num, State &s_state )
: timestamp( s_timestamp ), num( s_num ), state( s_state )
{}

/* For use with find_if, remove_if */
bool num_eq( uint64_t v ) const { return num == v; }
bool num_lt( uint64_t v ) const { return num < v; }
};
}

Expand Down

0 comments on commit 8369497

Please sign in to comment.