EXmM |void |_invlist_intersection |NN SV* const a|NN SV* const b|NN SV** i
EXpM |void |_invlist_intersection_maybe_complement_2nd|NULLOK SV* const a|NN SV* const b|bool complement_b|NN SV** i
EXpM |void |_invlist_union |NULLOK SV* const a|NN SV* const b|NN SV** output
-EXpM |void |_invlist_subtract|NN SV* const a|NN SV* const b|NN SV** result
+EXmM |void |_invlist_subtract|NN SV* const a|NN SV* const b|NN SV** result
EXpM |void |_invlist_invert|NN SV* const invlist
EXpM |void |_invlist_invert_prop|NN SV* const invlist
EXMpR |HV* |_swash_inversion_hash |NN SV* const swash
#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)
-#define _invlist_subtract(a,b,c) Perl__invlist_subtract(aTHX_ a,b,c)
#define _invlist_union(a,b,c) Perl__invlist_union(aTHX_ a,b,c)
#define _new_invlist(a) Perl__new_invlist(aTHX_ a)
#define _swash_inversion_hash(a) Perl__swash_inversion_hash(aTHX_ a)
#define PERL_ARGS_ASSERT__INVLIST_POPULATE_SWATCH \
assert(invlist); assert(swatch)
-PERL_CALLCONV void Perl__invlist_subtract(pTHX_ SV* const a, SV* const b, SV** result)
+/* PERL_CALLCONV void _invlist_subtract(pTHX_ SV* const a, SV* const b, SV** result)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2)
- __attribute__nonnull__(pTHX_3);
-#define PERL_ARGS_ASSERT__INVLIST_SUBTRACT \
- assert(a); assert(b); assert(result)
+ __attribute__nonnull__(pTHX_3); */
PERL_CALLCONV void Perl__invlist_union(pTHX_ SV* const a, SV* const b, SV** output)
__attribute__nonnull__(pTHX_2)
return new_invlist;
}
-#ifndef PERL_IN_XSUB_RE
-void
-Perl__invlist_subtract(pTHX_ SV* const a, SV* const b, SV** result)
-{
- /* Point <result> to an inversion list which consists of all elements in
- * <a> that aren't also in <b>. *result should be defined upon input, and
- * if it points to C<b> its reference count will be decremented. */
-
- PERL_ARGS_ASSERT__INVLIST_SUBTRACT;
- assert(a != b);
-
- /* Subtracting nothing retains the original */
- if (invlist_len(b) == 0) {
-
- if (*result == b) {
- SvREFCNT_dec(b);
- }
-
- /* If the result is not to be the same variable as the original, create
- * a copy */
- if (*result != a) {
- *result = invlist_clone(a);
- }
- } else {
- SV *b_copy = invlist_clone(b);
- _invlist_invert(b_copy); /* Everything not in 'b' */
-
- if (*result == b) {
- SvREFCNT_dec(b);
- }
-
- _invlist_intersection(a, b_copy, result); /* Everything in 'a' not in
- 'b' */
- SvREFCNT_dec(b_copy);
- }
-
- return;
-}
-#endif
-
PERL_STATIC_INLINE UV*
S_get_invlist_iter_addr(pTHX_ SV* invlist)
{
#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_UTF8_C)
#define _invlist_intersection(a, b, output) _invlist_intersection_maybe_complement_2nd(a, b, FALSE, output)
+
+/* Subtracting b from a leaves in a everything that was there that isn't in b,
+ * that is the intersection of a with b's complement */
+#define _invlist_subtract(a, b, output) _invlist_intersection_maybe_complement_2nd(a, b, TRUE, output)
#endif
/*