XOR reads more clearly to me than ?:
Yuval Kogman [Thu, 21 Aug 2008 10:53:42 +0000 (10:53 +0000)]
Moose.xs

index 9944abd..5f6e37c 100644 (file)
--- a/Moose.xs
+++ b/Moose.xs
@@ -469,7 +469,7 @@ STATIC bool check_sv_type (TC type, SV *sv) {
             if ( sv_isobject(sv) ) {
                 char *name = HvNAME_get(SvSTASH(SvRV(sv)));
                 bool is_regexp = strEQ("Regexp", name);
-                return ( type == RegexpRef ? is_regexp : !is_regexp );
+                return ( (type == RegexpRef) ^ !is_regexp );
             }
             return 0;
             break;