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
+4 -2
View File
@@ -195,9 +195,10 @@ static int vt_parser( int fd, Parser::UTF8Parser *parser )
}
/* feed to parser */
Parser::Actions actions;
for ( int i = 0; i < bytes_read; i++ ) {
std::list<Parser::Action *> actions = parser->input( buf[ i ] );
for ( std::list<Parser::Action *>::iterator j = actions.begin();
parser->input( buf[ i ], actions );
for ( Parser::Actions::iterator j = actions.begin();
j != actions.end();
j++ ) {
@@ -218,6 +219,7 @@ static int vt_parser( int fd, Parser::UTF8Parser *parser )
fflush( stdout );
}
actions.clear();
}
return 0;