Isolated algorithmic improvements.

* Fix inefficient STL use around Parser::UTF8Parser.
* Reduce typeid() usage, change some of it to a virtual method
* Do multiple-line scrolls as a single move
This commit is contained in:
John Hood
2014-05-10 15:25:40 -04:00
parent 3fa42cb8bb
commit 8fdcdc88cd
11 changed files with 89 additions and 63 deletions
+3 -2
View File
@@ -46,16 +46,17 @@ string Complete::act( const string &str )
{
for ( unsigned int i = 0; i < str.size(); i++ ) {
/* parse octet into up to three actions */
list<Action *> actions( parser.input( str[ i ] ) );
parser.input( str[ i ], actions );
/* apply actions to terminal and delete them */
for ( list<Action *>::iterator it = actions.begin();
for ( Actions::iterator it = actions.begin();
it != actions.end();
it++ ) {
Action *act = *it;
act->act_on_terminal( &terminal );
delete act;
}
actions.clear();
}
return terminal.read_octets_to_host();