jwoolley 02/05/23 17:29:23
Modified: strmatch apr_strmatch.c
Log:
collapse some redundant logic. no functional change.
Revision Changes Path
1.2 +2 -6 apr-util/strmatch/apr_strmatch.c
Index: apr_strmatch.c
===================================================================
RCS file: /home/cvs/apr-util/strmatch/apr_strmatch.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -u -r1.1 -r1.2
--- apr_strmatch.c 9 May 2002 16:33:07 -0000 1.1
+++ apr_strmatch.c 24 May 2002 00:29:23 -0000 1.2
@@ -81,23 +81,19 @@
pattern->context = NULL;
return pattern;
}
- else if (case_sensitive) {
- pattern->compare = match_boyer_moore_horspool;
- }
- else {
- pattern->compare = match_boyer_moore_horspool_nocase;
- }
shift = (int *)apr_palloc(p, sizeof(int) * NUM_CHARS);
for (i = 0; i < NUM_CHARS; i++) {
shift[i] = pattern->length;
}
if (case_sensitive) {
+ pattern->compare = match_boyer_moore_horspool;
for (i = 0; i < pattern->length - 1; i++) {
shift[(int)s[i]] = pattern->length - i - 1;
}
}
else {
+ pattern->compare = match_boyer_moore_horspool_nocase;
for (i = 0; i < pattern->length - 1; i++) {
shift[apr_tolower(s[i])] = pattern->length - i - 1;
}