Skip to content

Commit 257c32a

Browse files
committed
Seal Node as well, use auto properties
1 parent e07abea commit 257c32a

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/SizeLimitedCache.cs

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private bool IsFull()
239239
/// <summary>
240240
/// Doubly linked list node class. Has 3 values: key, resource, permanence flag
241241
/// </summary>
242-
private class Node
242+
private sealed class Node
243243
{
244244
public Node(K key, V resource, bool isPermanent)
245245
{
@@ -248,41 +248,16 @@ public Node(K key, V resource, bool isPermanent)
248248
IsPermanent = isPermanent;
249249
}
250250

251-
public K Key
252-
{
253-
get { return _key; }
254-
set { _key = value; }
255-
}
251+
public K Key { get; }
256252

257-
public V Resource
258-
{
259-
get { return _resource; }
260-
set { _resource = value; }
261-
}
253+
public V Resource { get; set; }
262254

263-
public bool IsPermanent
264-
{
265-
get { return _isPermanent; }
266-
set { _isPermanent = value; }
267-
}
255+
public bool IsPermanent { get; set; }
268256

269-
public Node Next
270-
{
271-
get { return _next; }
272-
set { _next = value; }
273-
}
257+
public Node Next { get; set; }
274258

275-
public Node Previous
276-
{
277-
get { return _previous; }
278-
set { _previous = value; }
279-
}
259+
public Node Previous { get; set; }
280260

281-
private V _resource;
282-
private K _key;
283-
private bool _isPermanent;
284-
private Node _next;
285-
private Node _previous;
286261
}
287262

288263
//*****************************************************

0 commit comments

Comments
 (0)