aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-07-27 00:16:15 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-07-27 00:16:15 -0700
commitdb969f34a99b5ab5efd3a82d3c6d5a8e9be6f2da (patch)
tree6a7a6d43bd58df5e8ba7a601db8600e4c3ad393e
parenta5a456fab33cb7c56101efe70aa4542154f6b9da (diff)
Micro optimization (probably not necessary)
-rw-r--r--match.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/match.c b/match.c
index bfae88e..6882c06 100644
--- a/match.c
+++ b/match.c
@@ -98,9 +98,8 @@ static match_t *cache_lookup(def_t *defs, const char *str, pat_t *pat)
if (!cache.matches) return NULL;
size_t h = hash(str, pat) & (cache.size-1);
for (match_t *c = cache.matches[h]; c; c = c->cache_next) {
- if (c->start == str && c->pat == pat && c->defs_id == defs->id) {
+ if (c->pat == pat && c->defs_id == defs->id && c->start == str)
return c;
- }
}
return NULL;
}