summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-12-10 23:05:25 +0000
committerNicholas Clark <nick@ccl4.org>2006-12-10 23:05:25 +0000
commita1cac82e623c5bbb331e6465011c5b46dfbfc277 (patch)
tree765d41726b3d032b5800bf8b245b05f5a9fc7dd5 /regcomp.h
parent0b3e77ec2e46a23afe97475f6b9bf7880fae85f1 (diff)
downloadperl-a1cac82e623c5bbb331e6465011c5b46dfbfc277.tar.gz
Remove code duplication in S_to_utf8_substr() and S_to_byte_substr()
by taking advantage of how anchored_* and float_* are stored in arrays to use a loop. p4raw-id: //depot/perl@29503
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/regcomp.h b/regcomp.h
index ce96da1f68..a5eb0fb06c 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -484,6 +484,8 @@ struct reg_data {
void* data[1];
};
+/* Code in S_to_utf8_substr() and S_to_byte_substr() in regexec.c accesses
+ anchored* and float* via array indexes 0 and 1. */
#define anchored_substr substrs->data[0].substr
#define anchored_utf8 substrs->data[0].utf8_substr
#define anchored_offset substrs->data[0].min_offset