No need to force to bool, when C does that automatically in the if statement. (#33045)
authorpi1024e <49824824+pi1024e@users.noreply.github.com>
Mon, 9 Mar 2020 19:28:57 +0000 (15:28 -0400)
committerGitHub <noreply@github.com>
Mon, 9 Mar 2020 19:28:57 +0000 (20:28 +0100)
In C, the if statement checks if the value is 0 or not 0. !!, or forcing to 1 or 0, is unnecessary here.

src/mono/mono/mini/interp/whitebox.c

index 24db2dc..e000fa5 100644 (file)
@@ -143,10 +143,8 @@ determine_verbose_level (TransformData *td)
                mono_method_desc_free (desc);
                if (match)
                        return 4;
-       } else {
-               if (strcmp (method->name, name) == 0)
-                       return 4;
-       }
+       } else if (!strcmp (method->name, name))
+               return 4;
 
        return 0;
 }
@@ -223,7 +221,7 @@ main (int argc, char* argv[])
                g_print ("test \"%s\": %d\n", ti->test_name, result);
                free (td);
 
-               if (!!result)
+               if (result)
                        test_failed++;
                else
                        test_success++;