Skip to content

Commit 66cd700

Browse files
committed
net9-10
1 parent 7d09528 commit 66cd700

File tree

6 files changed

+5
-58
lines changed

6 files changed

+5
-58
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
3+
<TargetFrameworks>net9.0;net10.0</TargetFrameworks>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

benchmarks/HydraScript.Benchmarks/GeneratedRegexContainer.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ namespace HydraScript.Benchmarks;
66

77
internal sealed partial class GeneratedRegexContainer : IGeneratedRegexContainer
88
{
9-
#if NET10_0
109
[GeneratedRegex(PatternContainer.Value, RegexOptions.Compiled)]
1110
public static partial Regex Regex { get; }
12-
#else
13-
[GeneratedRegex(PatternContainer.Value, RegexOptions.Compiled)]
14-
public static partial Regex GetRegex();
15-
16-
public static Regex Regex { get; } = GetRegex();
17-
#endif
1811
}

benchmarks/HydraScript.Benchmarks/InvokeBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace HydraScript.Benchmarks;
1010

11-
[SimpleJob(RuntimeMoniker.Net80)]
11+
[SimpleJob(RuntimeMoniker.Net90)]
1212
[SimpleJob(RuntimeMoniker.Net10_0, baseline: true)]
1313
[MemoryDiagnoser]
1414
public class InvokeBenchmark

src/Application/HydraScript.Application.StaticAnalysis/Impl/FunctionWithUndefinedReturnStorage.cs

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,27 @@ namespace HydraScript.Application.StaticAnalysis.Impl;
66

77
internal class FunctionWithUndefinedReturnStorage : IFunctionWithUndefinedReturnStorage
88
{
9-
#if NET10_0
109
private readonly OrderedDictionary<FunctionSymbolId, FunctionDeclaration> _declarations = [];
11-
#else
12-
private readonly Dictionary<FunctionSymbolId, FunctionDeclaration> _declarations = [];
13-
private readonly Dictionary<FunctionSymbolId, int> _keysWithOrder = [];
14-
#endif
1510

16-
public void Save(FunctionSymbol symbol, FunctionDeclaration declaration)
17-
{
18-
_declarations[symbol.Id] = declaration;
19-
#if NET10_0
20-
#else
21-
_keysWithOrder[symbol.Id] = _declarations.Count;
22-
#endif
23-
}
11+
public void Save(FunctionSymbol symbol, FunctionDeclaration declaration) => _declarations[symbol.Id] = declaration;
2412

2513
public FunctionDeclaration Get(FunctionSymbol symbol)
2614
{
2715
if (!_declarations.Remove(symbol.Id, out var declaration))
2816
throw new InvalidOperationException(message: $"Cannot get {symbol} that has not been saved");
29-
#if NET10_0
30-
#else
31-
_keysWithOrder.Remove(symbol.Id);
32-
#endif
17+
3318
return declaration;
3419
}
3520

36-
public void RemoveIfPresent(FunctionSymbol symbol)
37-
{
38-
_declarations.Remove(symbol.Id);
39-
#if NET10_0
40-
#else
41-
_keysWithOrder.Remove(symbol.Id);
42-
#endif
43-
}
21+
public void RemoveIfPresent(FunctionSymbol symbol) => _declarations.Remove(symbol.Id);
4422

4523
public IEnumerable<FunctionDeclaration> Flush()
4624
{
47-
#if NET10_0
4825
IReadOnlyList<FunctionSymbolId> keys = _declarations.Keys;
4926
while (keys.Count > 0)
5027
{
5128
yield return _declarations[keys[0]];
5229
_declarations.Remove(keys[0]);
5330
}
54-
#else
55-
return _declarations.OrderBy(kvp => _keysWithOrder[kvp.Key])
56-
.Select(x =>
57-
{
58-
_declarations.Remove(x.Key);
59-
_keysWithOrder.Remove(x.Key);
60-
return x.Value;
61-
});
62-
#endif
6331
}
6432
}

src/HydraScript/GeneratedRegexContainer.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ namespace HydraScript;
66

77
public sealed partial class GeneratedRegexContainer : IGeneratedRegexContainer
88
{
9-
#if NET10_0
109
[GeneratedRegex(PatternContainer.Value, RegexOptions.Compiled)]
1110
public static partial Regex Regex { get; }
12-
#else
13-
[GeneratedRegex(PatternContainer.Value, RegexOptions.Compiled)]
14-
public static partial Regex GetRegex();
15-
16-
public static Regex Regex { get; } = GetRegex();
17-
#endif
1811
}

tests/HydraScript.UnitTests/Domain/FrontEnd/DummyContainer.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ namespace HydraScript.UnitTests.Domain.FrontEnd;
55

66
public partial class DummyContainer : IGeneratedRegexContainer
77
{
8-
#if NET10_0
98
[GeneratedRegex(TokenInput.Pattern, RegexOptions.Compiled)]
109
public static partial Regex Regex { get; }
11-
#else
12-
[GeneratedRegex(TokenInput.Pattern, RegexOptions.Compiled)]
13-
public static partial Regex GetRegex();
14-
15-
public static Regex Regex { get; } = GetRegex();
16-
#endif
1710
}

0 commit comments

Comments
 (0)