From 66c4861b11b2eeb6e7e357c817d1d67c88fa57d2 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 4 Jun 2019 21:24:26 -0700 Subject: [PATCH] Shorter var names --- ask.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ask.c b/ask.c index 2a46ac6..1768a8b 100644 --- a/ask.c +++ b/ask.c @@ -38,18 +38,18 @@ static int score(const char *str, const char *patt) { if (!patt[0]) return 0; int score = 0; - const char *sp = str, *pp = patt; - while (*sp && !EQ(*sp, *pp)) ++sp; - while (*sp && *pp && EQ(*sp, *pp)) { + const char *s = str, *p = patt; + while (*s && !EQ(*s, *p)) ++s; + while (*s && *p && EQ(*s, *p)) { ++score; - ++sp; - ++pp; + ++s; + ++p; } - for (; *pp; ++sp, ++pp) { - while (*sp && !EQ(*sp, *pp)) ++sp; - if (!*sp) return 0; + for (; *p; ++s, ++p) { + while (*s && !EQ(*s, *p)) ++s; + if (!*s) return 0; } - if (*pp && !*sp) return 0; + if (*p && !*s) return 0; return score; }