Skip to content

Commit eb637db

Browse files
More cleaning
1 parent 39abb9e commit eb637db

5 files changed

Lines changed: 60 additions & 65 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project>
22
<PropertyGroup>
33
<LangVersion>latest</LangVersion>
4+
<ImplicitUsings>enable</ImplicitUsings>
45
</PropertyGroup>
56
</Project>
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net10.0</TargetFramework>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
98

10-
<ItemGroup>
11-
<PackageReference Include="BenchmarkDotNet" />
12-
<PackageReference Include="System.Runtime.Caching" />
13-
</ItemGroup>
9+
<ItemGroup>
10+
<PackageReference Include="BenchmarkDotNet" />
11+
<PackageReference Include="System.Runtime.Caching" />
12+
</ItemGroup>
1413

15-
<ItemGroup>
16-
<ProjectReference Include="..\FastCache\FastCache.csproj" />
17-
</ItemGroup>
14+
<ItemGroup>
15+
<ProjectReference Include="..\FastCache\FastCache.csproj" />
16+
</ItemGroup>
1817

1918
</Project>

FastCache/FastCache.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
using System;
21
using System.Collections;
32
using System.Collections.Concurrent;
4-
using System.Collections.Generic;
5-
using System.Threading;
6-
using System.Threading.Tasks;
73

84
namespace Jitbit.Utils;
95

@@ -15,9 +11,9 @@ internal static class FastCacheStatics
1511
/// <summary>
1612
/// faster MemoryCache alternative. basically a concurrent dictionary with expiration
1713
/// </summary>
18-
public class FastCache<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDisposable
14+
public class FastCache<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IDisposable where TKey : notnull
1915
{
20-
private readonly ConcurrentDictionary<TKey, TtlValue> _dict = new ConcurrentDictionary<TKey, TtlValue>();
16+
private readonly ConcurrentDictionary<TKey, TtlValue> _dict = new();
2117

2218
private readonly Lock _lock = new();
2319
private readonly Timer _cleanUpTimer;

FastCache/FastCache.csproj

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net8.0;net9.0;net10.0</TargetFrameworks>
5-
<PackageId>Jitbit.FastCache</PackageId>
6-
<Title>FastCache</Title>
7-
<Authors>Alex from Jitbit</Authors>
8-
<Product>FastCache</Product>
9-
<PackageProjectUrl>https://github.com/jitbit/fastcache</PackageProjectUrl>
10-
<PackageReadmeFile>README.md</PackageReadmeFile>
11-
<RepositoryUrl>https://github.com/jitbit/fastcache</RepositoryUrl>
12-
<PackageLicenseFile>LICENSE</PackageLicenseFile>
13-
<Version>1.1.3</Version>
14-
<PackageTags>cache;caching;MemoryCache</PackageTags>
15-
<Description>Fastest in-memory cache for .NET</Description>
16-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
17-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>net6.0;net8.0;net9.0;net10.0</TargetFrameworks>
5+
<PackageId>Jitbit.FastCache</PackageId>
6+
<Title>FastCache</Title>
7+
<Authors>Alex from Jitbit</Authors>
8+
<Product>FastCache</Product>
9+
<PackageProjectUrl>https://github.com/jitbit/fastcache</PackageProjectUrl>
10+
<PackageReadmeFile>README.md</PackageReadmeFile>
11+
<RepositoryUrl>https://github.com/jitbit/fastcache</RepositoryUrl>
12+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
13+
<Version>1.1.3</Version>
14+
<PackageTags>cache;caching;MemoryCache</PackageTags>
15+
<Description>Fastest in-memory cache for .NET</Description>
16+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
17+
</PropertyGroup>
1818

19-
<ItemGroup>
20-
<None Include="..\LICENSE">
21-
<Pack>True</Pack>
22-
<PackagePath>\</PackagePath>
23-
</None>
24-
<None Include="..\README.md">
25-
<Pack>True</Pack>
26-
<PackagePath>\</PackagePath>
27-
</None>
28-
</ItemGroup>
19+
<ItemGroup>
20+
<None Include="..\LICENSE">
21+
<Pack>True</Pack>
22+
<PackagePath>\</PackagePath>
23+
</None>
24+
<None Include="..\README.md">
25+
<Pack>True</Pack>
26+
<PackagePath>\</PackagePath>
27+
</None>
28+
</ItemGroup>
2929

30-
<ItemGroup>
31-
<PackageReference Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Include="Backport.System.Threading.Lock">
32-
<PrivateAssets>all</PrivateAssets>
33-
<IncludeAssets>analyzers</IncludeAssets>
34-
</PackageReference>
35-
</ItemGroup>
30+
<ItemGroup>
31+
<PackageReference Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Include="Backport.System.Threading.Lock">
32+
<PrivateAssets>all</PrivateAssets>
33+
<IncludeAssets>analyzers</IncludeAssets>
34+
</PackageReference>
35+
</ItemGroup>
3636

3737
</Project>

UnitTests/UnitTests.csproj

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>enable</Nullable>
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<IsPackable>false</IsPackable>
7+
<IsTestProject>true</IsTestProject>
8+
</PropertyGroup>
79

8-
<IsPackable>false</IsPackable>
9-
</PropertyGroup>
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
12+
<PackageReference Include="MSTest.TestAdapter" />
13+
<PackageReference Include="MSTest.TestFramework" />
14+
</ItemGroup>
1015

11-
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" />
13-
<PackageReference Include="MSTest.TestAdapter" />
14-
<PackageReference Include="MSTest.TestFramework" />
15-
</ItemGroup>
16-
17-
<ItemGroup>
18-
<ProjectReference Include="..\FastCache\FastCache.csproj" />
19-
</ItemGroup>
16+
<ItemGroup>
17+
<ProjectReference Include="..\FastCache\FastCache.csproj" />
18+
</ItemGroup>
2019

2120
</Project>

0 commit comments

Comments
 (0)