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
+5 -4
View File
@@ -123,15 +123,16 @@ void UserStream::apply_string( const string &diff )
}
}
const Parser::Action *UserStream::get_action( unsigned int i ) const
const Parser::Action &UserStream::get_action( unsigned int i ) const
{
switch( actions[ i ].type ) {
case UserByteType:
return &( actions[ i ].userbyte );
return actions[ i ].userbyte;
case ResizeType:
return &( actions[ i ].resize );
return actions[ i ].resize;
default:
assert( false );
return NULL;
static const Parser::Ignore nothing = Parser::Ignore();
return nothing;
}
}