[ion/simulator] Used buffer I/O

Avoid making a syscall for every single byte
This commit is contained in:
Romain Goyet
2020-09-17 15:49:11 -04:00
committed by Léa Saviot
parent 8059821025
commit f578c24af1

View File

@@ -37,8 +37,9 @@ static inline bool load(FILE * f) {
// Events
Ion::Events::Journal * journal = Journal::replayJournal();
while (fread(buffer, 1, 1, f) == 1) {
Ion::Events::Event e = Ion::Events::Event(buffer[0]);
int c = 0;
while ((c = getc(f)) != EOF) {
Ion::Events::Event e = Ion::Events::Event(c);
journal->pushEvent(e);
}
Ion::Events::replayFrom(journal);