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)
41
41
42
42
public override bool IsExtensionPresent ( string extension ) => IsExtensionPresent ( extension , GetCurrentDC ( ) ) ;
43
43
44
- private ConcurrentDictionary < nint , HashSet < string > > _extensions ;
44
+ private readonly ConcurrentDictionary < nint , HashSet < string > > _extensions = new ( ) ;
45
45
46
46
[ NativeApi ( EntryPoint = "wglGetExtensionsStringARB" ) ]
47
47
private partial string GetExtensionsString ( nint hdc ) ;
48
48
49
- private static HashSet < string > ? _empty ;
49
+ private static readonly HashSet < string > _empty = new ( ) ;
50
50
private bool _hasGetExtensionsString ;
51
51
52
52
public bool IsExtensionPresent ( string extension , nint hdc ) => _extensions . GetOrAdd
53
53
(
54
54
hdc , hdc => ! ( _hasGetExtensionsString =
55
55
_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 ( ' ' ) )
58
58
)
59
59
. Contains ( extension . StartsWith ( "WGL_" ) ? extension : $ "WGL_{ extension } ") ;
60
60
}
You can’t perform that action at this time.
0 commit comments