This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Performance optimisation in assert, suggested by Tim Bunce
[perl5.git] / scope.h
diff --git a/scope.h b/scope.h
index 9fd3bce..2f50398 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -140,7 +140,9 @@ scope has the given name. Name must be a literal string.
 #define LEAVE_with_name(name)                                          \
     STMT_START {                                                       \
        DEBUG_SCOPE("LEAVE \"" name "\"")                               \
-       assert(strEQ(PL_scopestack_name[PL_scopestack_ix-1], name));    \
+       assert(((char*)PL_scopestack_name[PL_scopestack_ix-1]           \
+                   == (char*)name)                                     \
+               || strEQ(PL_scopestack_name[PL_scopestack_ix-1], name));        \
        pop_scope();                                                    \
     } STMT_END
 #else