Remove boost::lambda from ConditionalOverlayCell::get_validity

This commit is contained in:
Keegan McAllister
2012-03-14 04:04:57 -04:00
committed by Keith Winstein
parent 83694977a7
commit 8f099cafbb
2 changed files with 10 additions and 4 deletions
+4 -4
View File
@@ -29,6 +29,8 @@
using namespace boost::lambda; using namespace boost::lambda;
using namespace Overlay; using namespace Overlay;
using std::max; using std::max;
using std::mem_fun_ref;
using std::bind2nd;
void ConditionalOverlayCell::apply( Framebuffer &fb, uint64_t confirmed_epoch, int row, bool flag ) const void ConditionalOverlayCell::apply( Framebuffer &fb, uint64_t confirmed_epoch, int row, bool flag ) const
{ {
@@ -88,12 +90,10 @@ Validity ConditionalOverlayCell::get_validity( const Framebuffer &fb, int row,
return CorrectNoCredit; return CorrectNoCredit;
} }
if ( (current.contents == replacement.contents) if ( current.contents_match( replacement ) ) {
|| (current.is_blank() && replacement.is_blank()) ) {
vector<Cell>::const_iterator it = vector<Cell>::const_iterator it =
find_if( original_contents.begin(), original_contents.end(), find_if( original_contents.begin(), original_contents.end(),
(replacement.is_blank() && bind( &Cell::is_blank, _1 )) bind2nd( mem_fun_ref( &Cell::contents_match ), replacement ) );
|| replacement.contents == (&_1)->*&Cell::contents );
if ( it == original_contents.end() ) { if ( it == original_contents.end() ) {
return Correct; return Correct;
} else { } else {
+6
View File
@@ -96,6 +96,12 @@ namespace Terminal {
|| ( (contents.size() == 1) && ( (contents.front() == 0x20) || ( (contents.size() == 1) && ( (contents.front() == 0x20)
|| (contents.front() == 0xA0) ) ) ); || (contents.front() == 0xA0) ) ) );
} }
bool contents_match ( const Cell& other ) const
{
return ( is_blank() && other.is_blank() )
|| ( contents == other.contents );
}
}; };
class Row { class Row {