Skip to content

Commit 42248d7

Browse files
author
Alex Peck
committed
merge
2 parents c11953a + 56d0d78 commit 42248d7

File tree

7 files changed

+13
-35
lines changed

7 files changed

+13
-35
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252

5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
55-
#- name: Autobuild
56-
# uses: github/codeql-action/autobuild@v2
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v2
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 https://git.io/JvXDl
@@ -66,16 +66,5 @@ jobs:
6666
# make bootstrap
6767
# make release
6868

69-
- name: Setup .NET SDK
70-
uses: actions/[email protected]
71-
with:
72-
dotnet-version: '9.0.x'
73-
74-
- name: Restore dependencies
75-
run: dotnet restore
76-
77-
- name: Build
78-
run: dotnet build --configuration Debug --no-restore
79-
8069
- name: Perform CodeQL Analysis
81-
uses: github/codeql-action/analyze@v2
70+
uses: github/codeql-action/analyze@v3

BitFaster.Caching.Benchmarks/BitFaster.Caching.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
2727
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" />
2828
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
29-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
29+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.2" />
3030
<PackageReference Include="System.Runtime.Caching" Version="8.0.1" />
3131
</ItemGroup>
3232

BitFaster.Caching.HitRateAnalysis/BitFaster.Caching.HitRateAnalysis.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>
3333
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
34-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
34+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.2" />
3535
<PackageReference Include="Plotly.NET.CSharp" Version="0.13.0" />
3636
<PackageReference Include="Plotly.NET.ImageExport" Version="6.1.0" />
3737
</ItemGroup>

BitFaster.Caching.ThroughputAnalysis/BitFaster.Caching.ThroughputAnalysis.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<PrivateAssets>all</PrivateAssets>
2727
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2828
</PackageReference>
29-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
29+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.2" />
3030
<PackageReference Include="Plotly.NET" Version="5.1.0" />
3131
<PackageReference Include="Plotly.NET.ImageExport" Version="6.1.0" />
3232
</ItemGroup>

BitFaster.Caching/Lru/Defaults.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ namespace BitFaster.Caching.Lru
66
{
77
internal static class Defaults
88
{
9-
public static int ConcurrencyLevel
10-
{
11-
get { return Environment.ProcessorCount; }
12-
}
13-
14-
public static readonly TimeSpan Infinite = new(0, 0, 0, 0, -1);
9+
public static int ConcurrencyLevel => Environment.ProcessorCount;
1510
}
1611
}

BitFaster.Caching/Lru/EqualCapacityPartition.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,23 @@ 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
{
22-
var (hot, warm, cold) = ComputeQueueCapacity(totalCapacity);
23-
this.hotCapacity = hot;
24-
this.warmCapacity = warm;
25-
this.coldCapacity = cold;
18+
(Hot, Warm, Cold) = ComputeQueueCapacity(totalCapacity);
2619
}
2720

2821
///<inheritdoc/>
29-
public int Cold => this.coldCapacity;
22+
public int Cold { get; }
3023

3124
///<inheritdoc/>
32-
public int Warm => this.warmCapacity;
25+
public int Warm { get; }
3326

3427
///<inheritdoc/>
35-
public int Hot => this.hotCapacity;
28+
public int Hot { get; }
3629

3730
private static (int hot, int warm, int cold) ComputeQueueCapacity(int capacity)
3831
{

BitFaster.Caching/Lru/LruPolicy.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Runtime.CompilerServices;
3+
using System.Threading;
34

45
namespace BitFaster.Caching.Lru
56
{
@@ -10,7 +11,7 @@ namespace BitFaster.Caching.Lru
1011
where K : notnull
1112
{
1213
///<inheritdoc/>
13-
public TimeSpan TimeToLive => Defaults.Infinite;
14+
public TimeSpan TimeToLive => Timeout.InfiniteTimeSpan;
1415

1516
///<inheritdoc/>
1617
[MethodImpl(MethodImplOptions.AggressiveInlining)]

0 commit comments

Comments
 (0)