-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: c# 12, .net 8, upgraded all dependencies
- Loading branch information
Showing
179 changed files
with
10,921 additions
and
12,367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=WpfVncClient_002EAnnotations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> | ||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=WpfVncClient_002EAnnotations/@EntryIndexedValue">True</s:Boolean> | ||
|
||
|
||
|
||
|
||
</wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<OutputType>Exe</OutputType> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<OutputType>Exe</OutputType> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.Linq; | ||
using BenchmarkDotNet.Attributes; | ||
|
||
namespace Benchmarks | ||
namespace Benchmarks; | ||
|
||
public class ImmutableDictionaryLookup | ||
{ | ||
public class ImmutableDictionaryLookup | ||
{ | ||
private const int Index = 500; | ||
private readonly IImmutableDictionary<int, object> _dictionary= Enumerable.Range(0, 1000).ToImmutableDictionary(i => i, i => new object()); | ||
private const int Index = 500; | ||
|
||
[Benchmark] | ||
public object Indexer() | ||
{ | ||
if (!_dictionary.ContainsKey(Index)) | ||
return null; | ||
return _dictionary[Index]; | ||
} | ||
private readonly IImmutableDictionary<int, object> _dictionary = | ||
Enumerable.Range(0, 1000).ToImmutableDictionary(i => i, _ => new object()); | ||
|
||
[Benchmark] | ||
public object TryGet() | ||
[Benchmark] | ||
public object? Indexer() => CollectionExtensions.GetValueOrDefault(_dictionary, Index); | ||
|
||
[Benchmark] | ||
public object? TryCatch() | ||
{ | ||
try | ||
{ | ||
if (!_dictionary.TryGetValue(Index, out object value)) | ||
return null; | ||
return value; | ||
return _dictionary[Index]; | ||
} | ||
|
||
[Benchmark] | ||
public object TryCatch() | ||
catch | ||
{ | ||
try | ||
{ | ||
return _dictionary[Index]; | ||
} | ||
catch | ||
{ | ||
return null; | ||
} | ||
return null; | ||
} | ||
} | ||
|
||
[Benchmark] | ||
public object? TryGet() => CollectionExtensions.GetValueOrDefault(_dictionary, Index); | ||
} |
Oops, something went wrong.