Skip to content

Commit

Permalink
simplify index expression
Browse files Browse the repository at this point in the history
  • Loading branch information
svpv committed Nov 15, 2006
1 parent b8cd7ce commit 5ca6b2d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pcre.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ void regexp(sqlite3_context *ctx, int argc, sqlite3_value **argv)
pcre_free(c.e);
return;
}
if (cache[CACHE_SIZE-1].s) {
free(cache[CACHE_SIZE-1].s);
assert(cache[CACHE_SIZE-1].p);
pcre_free(cache[CACHE_SIZE-1].p);
pcre_free(cache[CACHE_SIZE-1].e);
i = CACHE_SIZE - 1;
if (cache[i].s) {
free(cache[i].s);
assert(cache[i].p);
pcre_free(cache[i].p);
pcre_free(cache[i].e);
}
memmove(cache + 1, cache, (CACHE_SIZE - 1) * sizeof(cache_entry));
memmove(cache + 1, cache, i * sizeof(cache_entry));
cache[0] = c;
}
p = cache[0].p;
Expand Down

0 comments on commit 5ca6b2d

Please sign in to comment.