Use shared_ptr and references for Actions.

This slows terminal emulation slightly.
This commit is contained in:
John Hood
2017-05-11 01:22:12 -04:00
parent c6c7f09954
commit 42d2b5d029
13 changed files with 104 additions and 113 deletions
+2 -4
View File
@@ -270,8 +270,7 @@ static void emulate_terminal( int fd )
std::string terminal_to_host;
for ( int i = 0; i < bytes_read; i++ ) {
Parser::UserByte ub( buf[ i ] );
terminal_to_host += complete.act( &ub );
terminal_to_host += complete.act( Parser::UserByte( buf[ i ] ) );
}
if ( swrite( fd, terminal_to_host.c_str(), terminal_to_host.length() ) < 0 ) {
@@ -302,8 +301,7 @@ static void emulate_terminal( int fd )
}
/* tell emulator */
Parser::Resize r( window_size.ws_col, window_size.ws_row );
complete.act( &r );
complete.act( Parser::Resize( window_size.ws_col, window_size.ws_row ) );
/* tell child process */
if ( ioctl( fd, TIOCSWINSZ, &window_size ) < 0 ) {