From bfad64695cb06a3d4388d164403a6699ed60e7f8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 16 May 2012 09:24:12 +0200 Subject: [PATCH] optimize the number of failed findparam calls a little bit --- src/kernel/order.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/kernel/order.c b/src/kernel/order.c index 1ea62abf9..d595ebf18 100644 --- a/src/kernel/order.c +++ b/src/kernel/order.c @@ -377,6 +377,7 @@ boolean is_repeated(const order * ord) { keyword_t kwd = ORD_KEYWORD(ord); const struct locale *lang = ORD_LOCALE(ord); + const char * s; param_t param; switch (kwd) { @@ -405,11 +406,14 @@ boolean is_repeated(const order * ord) parser_pushstate(); init_tokens(ord); skip_token(); - param = getparam(lang); - parser_popstate(); - - if (param == P_SHIP) - return true; + s = getstrtoken(); + if (s[0]>'9') { + param = findparam(s, lang); + parser_popstate(); + if (param == P_SHIP) { + return true; + } + } break; case K_MAKE: @@ -421,11 +425,12 @@ boolean is_repeated(const order * ord) parser_pushstate(); init_tokens(ord); /* initialize token-parser */ skip_token(); - param = getparam(lang); - parser_popstate(); - - if (param != P_TEMP) - return true; + s = getstrtoken(); + if (s[0]>'9') { + param = findparam(s, lang); + parser_popstate(); + return param != P_TEMP; + } break; default: return false;