Switched to reading the entire file into a buffer at the start.\nThis speeds it up a TON (like 100x).

This commit is contained in:
Jesse Beder
2009-02-01 20:48:43 +00:00
parent a6d5902ebf
commit f9c0725684
9 changed files with 72 additions and 75 deletions

View File

@@ -32,7 +32,7 @@ namespace YAML
// and saves it on a stack.
void Scanner::InsertSimpleKey()
{
SimpleKey key(INPUT.pos(), INPUT.line, INPUT.column, m_flowLevel);
SimpleKey key(INPUT.pos, INPUT.line, INPUT.column, m_flowLevel);
// first add a map start, if necessary
key.pMapStart = PushIndentTo(INPUT.column, false);
@@ -78,7 +78,7 @@ namespace YAML
isValid = false;
// also needs to be less than 1024 characters and inline
if(INPUT.line != key.line || INPUT.pos() - key.pos > 1024)
if(INPUT.line != key.line || INPUT.pos - key.pos > 1024)
isValid = false;
// invalidate key