mirror of
https://github.com/bradgrantham/apple2a.git
synced 2024-10-31 23:09:39 +00:00
Speed up tokenization a bit.
This commit is contained in:
parent
013056e778
commit
fb467e5289
3
main.c
3
main.c
@ -625,7 +625,8 @@ static uint16_t tokenize(uint8_t *s) {
|
||||
|
||||
// Try every token.
|
||||
for (i = 0; i < TOKEN_COUNT; i++) {
|
||||
skipped = skip_over(s, TOKEN[i]);
|
||||
// Quick optimization, peek at the first letter.
|
||||
skipped = s[0] == TOKEN[i][0] ? skip_over(s, TOKEN[i]) : 0;
|
||||
if (skipped != 0) {
|
||||
// Record token.
|
||||
*t++ = 0x80 + i;
|
||||
|
Loading…
Reference in New Issue
Block a user