From: H.G.Muller Date: Tue, 9 Feb 2016 08:31:11 +0000 (+0100) Subject: Slight speedup of parsing promotion suffix X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=69992f105f8efcdc71dc04a96d14f2b6e6f25fac Slight speedup of parsing promotion suffix --- diff --git a/parser.c b/parser.c index 471ae94..946729e 100644 --- a/parser.c +++ b/parser.c @@ -381,6 +381,7 @@ char PromoSuffix (char **p) { char *start = *p; + if(**p == ' ') return NULLCHAR; // common case, test explicitly for speed if(**p == 'e' && (Match("ep", p) || Match("e.p.", p))) { *p = start; return NULLCHAR; } // non-compliant e.p. suffix is no promoChar! if(**p == '+' && IS_SHOGI(gameInfo.variant)) { (*p)++; return '+'; } if(**p == '=' || (gameInfo.variant == VariantSChess) && **p == '/') (*p)++; // optional = (or / for Seirawan gating)