diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-02-03 10:32:15 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-02-09 10:13:54 -0700 |
commit | 52ae8f7ebb1f32bbd4f574c090ff4ae9d6b468c7 (patch) | |
tree | 77b71b06f5772f2e2ad5e2b8a849759d5f5591c6 /proto.h | |
parent | 112b0fc601abb62ef38610a2a8edb67f8f59fade (diff) | |
download | perl-52ae8f7ebb1f32bbd4f574c090ff4ae9d6b468c7.tar.gz |
regcomp.c: Add ability to take intersection of complement
It turns out that it is a common paradigm to want to take the
intersection of an inversion list with the complement of another
inversion list. In fact, this is the how to subtract the second
inversion list from the first, as what remains in the first after the
subtraction is everything in it that is not in the second.
It also turns out that it adds very few cycles to an intersection to
complement one (or both, should we choose to) of the operands. By
adding this capability, we don't have to create a copy of the inverted
operand beforehand, just to throw it away.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -6550,12 +6550,16 @@ PERL_CALLCONV void Perl__append_range_to_invlist(pTHX_ SV* const invlist, const #define PERL_ARGS_ASSERT__APPEND_RANGE_TO_INVLIST \ assert(invlist) -PERL_CALLCONV void Perl__invlist_intersection(pTHX_ SV* const a, SV* const b, SV** i) +/* PERL_CALLCONV void _invlist_intersection(pTHX_ SV* const a, SV* const b, SV** i) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) - __attribute__nonnull__(pTHX_3); -#define PERL_ARGS_ASSERT__INVLIST_INTERSECTION \ - assert(a); assert(b); assert(i) + __attribute__nonnull__(pTHX_3); */ + +PERL_CALLCONV void Perl__invlist_intersection_maybe_complement_2nd(pTHX_ SV* const a, SV* const b, bool complement_b, SV** i) + __attribute__nonnull__(pTHX_2) + __attribute__nonnull__(pTHX_4); +#define PERL_ARGS_ASSERT__INVLIST_INTERSECTION_MAYBE_COMPLEMENT_2ND \ + assert(b); assert(i) PERL_CALLCONV void Perl__invlist_invert(pTHX_ SV* const invlist) __attribute__nonnull__(pTHX_1); |