diff options
author | Tom Lane | 2012-07-07 21:39:50 +0000 |
---|---|---|
committer | Tom Lane | 2012-07-07 21:39:50 +0000 |
commit | c6aae3042be5249e672b731ebeb21875b5343010 (patch) | |
tree | cc5a7b837854edb3573a915766377501a7ac949e /src/backend/regex/regcomp.c | |
parent | a184e4db83c80d28103774ced984c7790fbd44ba (diff) |
Simplify and document regex library's compact-NFA representation.
The previous coding abused the first element of a cNFA state's arcs list
to hold a per-state flag bit, which was confusing, undocumented, and not
even particularly efficient. Get rid of that in favor of a separate
"stflags" vector. Since there's only one bit in use, I chose to allocate a
char per state; we could possibly replace this with a bitmap at some point,
but that would make accesses a little slower. It's already about 8X
smaller than before, so let's not get overly tense.
Also document the representation better than it was before, which is to say
not at all.
This patch is a byproduct of investigations towards extracting a "fixed
prefix" string from the compact-NFA representation of regex patterns.
Might need to back-patch it if we decide to back-patch that fix, but for
now it's just code cleanup so I'll just put it in HEAD.
Diffstat (limited to 'src/backend/regex/regcomp.c')
-rw-r--r-- | src/backend/regex/regcomp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index 57055f04abb..ceb6f0f8737 100644 --- a/src/backend/regex/regcomp.c +++ b/src/backend/regex/regcomp.c @@ -162,7 +162,7 @@ static void dumparcs(struct state *, FILE *); static int dumprarcs(struct arc *, struct state *, FILE *, int); static void dumparc(struct arc *, struct state *, FILE *); static void dumpcnfa(struct cnfa *, FILE *); -static void dumpcstate(int, struct carc *, struct cnfa *, FILE *); +static void dumpcstate(int, struct cnfa *, FILE *); #endif /* === regc_cvec.c === */ static struct cvec *newcvec(int, int); |