From 52ae8f7ebb1f32bbd4f574c090ff4ae9d6b468c7 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 3 Feb 2012 10:32:15 -0700 Subject: 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. --- embed.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'embed.h') diff --git a/embed.h b/embed.h index 519006250d..66dfe9a7ad 100644 --- a/embed.h +++ b/embed.h @@ -949,7 +949,7 @@ # endif # if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_UTF8_C) #define _append_range_to_invlist(a,b,c) Perl__append_range_to_invlist(aTHX_ a,b,c) -#define _invlist_intersection(a,b,c) Perl__invlist_intersection(aTHX_ a,b,c) +#define _invlist_intersection_maybe_complement_2nd(a,b,c,d) Perl__invlist_intersection_maybe_complement_2nd(aTHX_ a,b,c,d) #define _invlist_invert(a) Perl__invlist_invert(aTHX_ a) #define _invlist_invert_prop(a) Perl__invlist_invert_prop(aTHX_ a) #define _invlist_populate_swatch(a,b,c,d) Perl__invlist_populate_swatch(aTHX_ a,b,c,d) -- cgit v1.2.1