Fix typo & make the code leaner (#25442)
authorJan Kotas <jkotas@microsoft.com>
Thu, 27 Jun 2019 01:25:21 +0000 (18:25 -0700)
committerGitHub <noreply@github.com>
Thu, 27 Jun 2019 01:25:21 +0000 (18:25 -0700)
Enum.HasFlag generates bigger IL and depends on complex JIT optimization for a good code.
The classic bit check is strongly preferred accross CoreCLR and CoreFX.

src/System.Private.CoreLib/shared/System/Diagnostics/StackTrace.cs

index 3855a5c..5291c49 100644 (file)
@@ -340,11 +340,11 @@ namespace System.Diagnostics
         {
             Debug.Assert(mb != null);
 
-            if (mb.MethodImplementationFlags.HasFlag(MethodImplAttributes.AggressiveInlining))
+            if ((mb.MethodImplementationFlags & MethodImplAttributes.AggressiveInlining) != 0)
             {
                 // Aggressive Inlines won't normally show in the StackTrace; however for Tier0 Jit and
                 // cross-assembly AoT/R2R these inlines will be blocked until Tier1 Jit re-Jits 
-                // them when they will inline. We don't show them in the StackTrace to bring consitency
+                // them when they will inline. We don't show them in the StackTrace to bring consistency
                 // between this first-pass asm and fully optimized asm.
                 return false;
             }