Skip to content

Commit 4c56715

Browse files
committed
Use auto-implemented properties
1 parent da00197 commit 4c56715

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

BitFaster.Caching/Lru/EqualCapacityPartition.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,26 @@ namespace BitFaster.Caching.Lru
99
[DebuggerDisplay("{Hot}/{Warm}/{Cold}")]
1010
public class EqualCapacityPartition : ICapacityPartition
1111
{
12-
private readonly int hotCapacity;
13-
private readonly int warmCapacity;
14-
private readonly int coldCapacity;
15-
1612
/// <summary>
1713
/// Initializes a new instance of the EqualCapacityPartition class with the specified total capacity.
1814
/// </summary>
1915
/// <param name="totalCapacity">The total capacity.</param>
2016
public EqualCapacityPartition(int totalCapacity)
2117
{
2218
var (hot, warm, cold) = ComputeQueueCapacity(totalCapacity);
23-
this.hotCapacity = hot;
24-
this.warmCapacity = warm;
25-
this.coldCapacity = cold;
19+
this.Hot = hot;
20+
this.Warm = warm;
21+
this.Cold = cold;
2622
}
2723

2824
///<inheritdoc/>
29-
public int Cold => this.coldCapacity;
25+
public int Cold { get; }
3026

3127
///<inheritdoc/>
32-
public int Warm => this.warmCapacity;
28+
public int Warm { get; }
3329

3430
///<inheritdoc/>
35-
public int Hot => this.hotCapacity;
31+
public int Hot { get; }
3632

3733
private static (int hot, int warm, int cold) ComputeQueueCapacity(int capacity)
3834
{

0 commit comments

Comments
 (0)