diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-10-01 14:35:17 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-10-01 14:35:17 -0700 |
| commit | 89887711586d289db6fd013ffd8407d381992663 (patch) | |
| tree | 99d352fc89705e345243c8f07bc6d1df1db972c2 /match.c | |
| parent | 5f0a7a876ad3add4319eddb57eb7e4aed5ba57bc (diff) | |
Fix
Diffstat (limited to 'match.c')
| -rw-r--r-- | match.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -115,7 +115,7 @@ static void cache_save(match_ctx_t *ctx, const char *str, pat_t *pat, match_t *m cache_t *cache = ctx->cache; if (cache->occupancy+1 > 3*cache->size) { if (cache->size == MAX_CACHE_SIZE) { - size_t h = hash(m->start, m->pat->id) & (cache->size-1); + size_t h = hash(str, pat->id) & (cache->size-1); for (int quota = 2; cache->matches[h] && quota > 0; quota--) { cache_hit_t **last_home = &cache->matches[h]; while ((*last_home)->next) |
