Skip to content

Commit b5dab8b

Browse files
committed
seal the class for additional perf benefit
1 parent c206793 commit b5dab8b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Component/AdornerPresentationContext.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
using System.Windows.Annotations;
2020
using System.Windows.Documents;
2121
using System.Windows.Media;
22-
using System.Collections;
2322

2423
namespace MS.Internal.Annotations.Component
2524
{
@@ -29,7 +28,7 @@ namespace MS.Internal.Annotations.Component
2928
/// for a different annotation component (located in the same adorner layer) works, but is slower than using the presentation context stored in the
3029
/// annotation component.
3130
/// </summary>
32-
internal class AdornerPresentationContext : PresentationContext
31+
internal sealed class AdornerPresentationContext : PresentationContext
3332
{
3433
#region Constructors
3534

@@ -120,7 +119,7 @@ internal static void SetTypeZLevel(Type type, int level)
120119
/// <param name="max">max Z-order value for this level</param>
121120
internal static void SetZLevelRange(int level, int min, int max)
122121
{
123-
if (s_ZRanges.ContainsKey(level) == false)
122+
if (!s_ZRanges.ContainsKey(level))
124123
{
125124
s_ZRanges.Add(level, new ZRange(min, max));
126125
}

0 commit comments

Comments
 (0)