X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/d8732c60696bbb69e2a8d8d28eed06f5eb2034a6..fb387a96f609c00a517aa640d941f26f1e52f15a:/regcomp.c diff --git a/regcomp.c b/regcomp.c index 953a94d..7b31295 100644 --- a/regcomp.c +++ b/regcomp.c @@ -10101,20 +10101,9 @@ Perl__invlistEQ(pTHX_ SV* const a, SV* const b, const bool complement_b) } } - /* Make sure that the lengths are the same, as well as the final element - * before looping through the remainder. (Thus we test the length, final, - * and first elements right off the bat) */ - if (len_a != len_b || array_a[len_a-1] != array_b[len_a-1]) { - retval = FALSE; - } - else for (i = 0; i < len_a - 1; i++) { - if (array_a[i] != array_b[i]) { - retval = FALSE; - break; - } - } + return len_a == len_b + && memEQ(array_a, array_b, len_a * sizeof(array_a[0])); - return retval; } #endif