From 69992f105f8efcdc71dc04a96d14f2b6e6f25fac Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 9 Feb 2016 09:31:11 +0100 Subject: [PATCH] Slight speedup of parsing promotion suffix --- parser.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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) -- 1.7.0.4