We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80bc356 commit e4b79adCopy full SHA for e4b79ad
1 file changed
1.md
@@ -196,11 +196,11 @@ public class Factory
196
{
197
return Cache<T>.Instance;
198
}
199
-
+
200
private static class Cache<T>
201
where T : new()
202
203
- public static readonly T Instance = new T();
+ public static readonly T Instance = new();
204
205
206
```
@@ -215,12 +215,12 @@ public class Factory
215
216
217
218
219
220
221
222
public static readonly T Instance = CallExpensiveMethodToBuildANewInstance();
223
224
private static T CallExpensiveMethodToBuildANewInstance()
225
226
// Imagine a really complex process to construct T
0 commit comments