Is there any more efficient way of converting a text file to an array of strings in Squirrel?
Code:
function read_line()
{
local line="";
local char;
while ( !eos() )
{
if ( _blb.eos() && _f && !_f.eos() )
_blb = _f.readblob( _readsize );
while ( !_blb.eos() )
{
char = _blb.readn( 'b' );
if ( char == '\n' )
return strip( line );
line += char.tochar();
}
}
return line;
}
This is the code I'm using atm to read a line and it's very inneficient to call getchar() for each letter