small optimizations in switch order

This commit is contained in:
Roberto Ierusalimschy
1998-01-09 12:44:55 -02:00
parent 26679b1a48
commit 0e1058cfdd
6 changed files with 38 additions and 37 deletions

11
llex.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 1.11 1997/12/17 20:48:58 roberto Exp roberto $
** $Id: llex.c,v 1.12 1997/12/22 17:52:20 roberto Exp roberto $
** Lexical Analizer
** See Copyright Notice in lua.h
*/
@@ -268,15 +268,16 @@ int luaY_lex (YYSTYPE *l)
LS->linelasttoken = LS->linenumber;
while (1) {
switch (LS->current) {
case '\n':
inclinenumber(LS);
LS->linelasttoken = LS->linenumber;
continue;
case ' ': case '\t': case '\r': /* CR: to avoid problems with DOS */
next(LS);
continue;
case '\n':
inclinenumber(LS);
LS->linelasttoken = LS->linenumber;
continue;
case '-':
save_and_next(LS);
if (LS->current != '-') return '-';