File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -41,20 +41,20 @@ public bool TryGetExtension<T>(out T ext, nint hdc)
4141
4242 public override bool IsExtensionPresent ( string extension ) => IsExtensionPresent ( extension , GetCurrentDC ( ) ) ;
4343
44- private ConcurrentDictionary < nint , HashSet < string > > _extensions ;
44+ private readonly ConcurrentDictionary < nint , HashSet < string > > _extensions = new ( ) ;
4545
4646 [ NativeApi ( EntryPoint = "wglGetExtensionsStringARB" ) ]
4747 private partial string GetExtensionsString ( nint hdc ) ;
4848
49- private static HashSet < string > ? _empty ;
49+ private static readonly HashSet < string > _empty = new ( ) ;
5050 private bool _hasGetExtensionsString ;
5151
5252 public bool IsExtensionPresent ( string extension , nint hdc ) => _extensions . GetOrAdd
5353 (
5454 hdc , hdc => ! ( _hasGetExtensionsString =
5555 _hasGetExtensionsString || GetProcAddress ( "wglGetExtensionsStringARB" ) != 0 )
56- ? _empty ??= new HashSet < string > ( )
57- : new HashSet < string > ( GetExtensionsString ( hdc ) . Split ( ' ' ) )
56+ ? _empty
57+ : new HashSet < string > ( GetExtensionsString ( hdc ) . Split ( ' ' ) )
5858 )
5959 . Contains ( extension . StartsWith ( "WGL_" ) ? extension : $ "WGL_{ extension } ") ;
6060 }
You can’t perform that action at this time.
0 commit comments